Update Dockerfile
Browse files- Dockerfile +18 -55
Dockerfile
CHANGED
|
@@ -1,57 +1,20 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
# INSTALL REMOTE DESKTOP
|
| 22 |
-
RUN wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
|
| 23 |
-
RUN dpkg --install chrome-remote-desktop_current_amd64.deb
|
| 24 |
-
RUN apt-get install --assume-yes --fix-broken
|
| 25 |
-
RUN bash -c 'echo "exec /etc/X11/Xsession /usr/bin/xfce4-session" > /etc/chrome-remote-desktop-session'
|
| 26 |
-
# ----------------------------------------------------------
|
| 27 |
-
# SPECIFY VARIABLES FOR SETTING UP CHROME REMOTE DESKTOP
|
| 28 |
-
ARG USER=
|
| 29 |
-
ARG PIN=123321
|
| 30 |
-
ARG CODE=4/0AVGzR1D39_ZQ-PQdZw9FcGRqmFlHQlVS6m7QlPVH4BSxvdBdLND0iobsgwTj339C2thRcw
|
| 31 |
-
ARG HOSTNAME=
|
| 32 |
-
# ----------------------------------------------------------
|
| 33 |
-
# ADD USER TO THE SPECIFIED GROUPS
|
| 34 |
-
RUN adduser --disabled-password --gecos '' $USER
|
| 35 |
-
RUN mkhomedir_helper $USER
|
| 36 |
-
RUN adduser $USER sudo
|
| 37 |
-
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
| 38 |
-
RUN usermod -aG chrome-remote-desktop $USER
|
| 39 |
-
USER $USER
|
| 40 |
-
WORKDIR /home/$USER
|
| 41 |
-
RUN mkdir -p .config/chrome-remote-desktop
|
| 42 |
-
RUN chown "$USER:$USER" .config/chrome-remote-desktop
|
| 43 |
-
RUN chmod a+rx .config/chrome-remote-desktop
|
| 44 |
-
RUN touch .config/chrome-remote-desktop/host.json
|
| 45 |
-
# INSTALL GOOGLE'S CHROME REMOTE DESKTOP WITH CODE, HOSTNAME AND PIN FROM ENV VAR
|
| 46 |
-
RUN DISPLAY= /opt/google/chrome-remote-desktop/start-host --code=$CODE \
|
| 47 |
-
--redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$HOSTNAME --pin=$PIN
|
| 48 |
-
# COPY THE CONFIGURATION TO THE NEW FILE THAT MATCHES THE CORRECT HOSTNAME (MD5 HASH THEREOF)
|
| 49 |
-
RUN HOST_HASH=$(echo -n $HOSTNAME | md5sum | cut -c -32) && \
|
| 50 |
-
FILENAME=.config/chrome-remote-desktop/host#${HOST_HASH}.json && echo $FILENAME && \
|
| 51 |
-
cp .config/chrome-remote-desktop/host#*.json $FILENAME
|
| 52 |
-
RUN sudo service chrome-remote-desktop stop
|
| 53 |
-
RUN echo $HOSTNAME
|
| 54 |
-
RUN sudo service chrome-remote-desktop start
|
| 55 |
-
RUN echo $HOSTNAME
|
| 56 |
-
|
| 57 |
-
CMD [ "/bin/bash","-c","sleep 900"]
|
|
|
|
| 1 |
+
FROM python:3.13.5-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
| 4 |
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
build-essential \
|
| 7 |
+
curl \
|
| 8 |
+
git \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
COPY requirements.txt ./
|
| 12 |
+
COPY src/ ./src/
|
| 13 |
+
|
| 14 |
+
RUN pip3 install -r requirements.txt
|
| 15 |
+
|
| 16 |
+
EXPOSE 8501
|
| 17 |
+
|
| 18 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
+
|
| 20 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|