Spaces:
Paused

mihozzv commited on
Commit
9e73e7c
·
verified ·
1 Parent(s): 543b642

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -55
Dockerfile CHANGED
@@ -1,57 +1,20 @@
1
- FROM ubuntu:latest
2
 
3
- ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- # INSTALL SOURCES FOR CHROME REMOTE DESKTOP AND VSCODE
6
- RUN apt-get update && apt-get upgrade --assume-yes
7
- RUN apt-get --assume-yes install curl gpg wget
8
- RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
9
- mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
10
- RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
11
- RUN echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" | \
12
- tee /etc/apt/sources.list.d/vs-code.list
13
- RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
14
- # INSTALL XFCE DESKTOP AND DEPENDENCIES
15
- RUN apt-get update && apt-get upgrade --assume-yes
16
- RUN apt-get install --assume-yes --fix-missing sudo wget apt-utils xvfb xfce4 xbase-clients python3-xdg \
17
- python3-packaging python3-psutil dbus-x11 \
18
- desktop-base vim xscreensaver google-chrome-stable psmisc python3-psutil xserver-xorg-video-dummy libutempter0
19
- # INSTALL OTHER SOFTWARE (I.E VSCODE)
20
- RUN apt-get install --assume-yes --fix-missing code
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"]