-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
70 lines (57 loc) · 1.86 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This Dockerfile is used to build the Rubintv on a commit basis.
# The GH action will build the image and push it to the registry.
# The image will be used to deploy the application on dev servers.
# Note:
# I was not able to use the conda recipe to build the image,
# faced several issues which at the end I was not able to resolve
# and decided to use the python image instead.
# This is a temporary solution, and I will work on a better approach
# to build the image using conda.
# TODO: DM-43222.
FROM python:3.11.1-slim-bullseye
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && \
apt-get install -y \
libsasl2-dev \
python-dev \
libldap2-dev \
inetutils-ping \
vim \
nano \
procps \
findutils \
libssl-dev \
git curl unzip xz-utils zip libglu1-mesa \
python3-venv \
libgl1-mesa-glx && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Add a user with UID and GID 1000
RUN groupadd -g 1000 rubintv && \
useradd -r -u 1000 -g rubintv -m rubintv
# Setup work directory and adjust permissions
WORKDIR /usr/src/rubintv
RUN chown -R rubintv:rubintv /usr/src/rubintv
# Switch to the new user
USER rubintv
# Setup Flutter
RUN git clone https://github.com/flutter/flutter.git /home/rubintv/flutter
ENV PATH="/home/rubintv/flutter/bin:/home/rubintv/flutter/bin/cache/dart-sdk/bin:${PATH}"
RUN flutter doctor && \
flutter channel master && \
flutter upgrade
# Create a virtual environment
RUN python -m venv venv
# Activate virtual environment
ENV PATH="/usr/src/rubintv/venv/bin:$PATH"
# Copy the rest of the application
COPY --chown=rubintv:rubintv . .
# Install Python dependencies
RUN pip install -r requirements.txt && \
python setup.py install
# Adjust permissions for executable
RUN chmod +x start-daemon.sh
# Expose the port and define the CMD
EXPOSE 8000
CMD ["./start-daemon.sh"]