Poweruser01 commited on
Commit
e60d59b
·
verified ·
1 Parent(s): f99f69e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -15
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- # Use Ubuntu 22.04 as the base image for compatibility and minimal size
2
  FROM ubuntu:22.04
3
 
4
- # Set environment variables for non-interactive installation
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV USER=appuser
7
  ENV HOME=/home/$USER
@@ -10,7 +10,7 @@ ENV VNC_PORT=5901
10
  ENV NOVNC_PORT=7860
11
  ENV X11VNC_LOG=/tmp/x11vnc.log
12
 
13
- # Install dependencies: Xvfb, Fluxbox, x11vnc, noVNC, and utilities
14
  RUN apt-get update && apt-get install -y \
15
  wget \
16
  gnupg \
@@ -35,37 +35,33 @@ RUN wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb \
35
  && rm teamviewer_amd64.deb \
36
  && rm -rf /var/lib/apt/lists/*
37
 
38
- # Create a non-root user
39
  RUN useradd -m -s /bin/bash $USER
40
 
41
- # Fix permissions for X11 socket directory
42
  RUN mkdir -p /tmp/.X11-unix \
43
  && chmod 1777 /tmp/.X11-unix \
44
  && chown $USER:$USER /tmp/.X11-unix
45
 
46
- # Create a minimal Fluxbox config to suppress warnings
47
  RUN mkdir -p $HOME/.fluxbox
48
  COPY fluxbox_menu $HOME/.fluxbox/menu
49
  RUN chown -R $USER:$USER $HOME/.fluxbox
50
 
51
- # Set up noVNC web interface
52
  RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
53
 
54
- # Copy a startup script to run Brave in VNC
55
  RUN mkdir -p $HOME/scripts
56
  COPY start.sh $HOME/scripts/start.sh
57
  RUN chmod +x $HOME/scripts/start.sh
58
 
59
- # Force Google DNS so apps like Brave can resolve domains correctly
60
- RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && \
61
- echo "nameserver 8.8.4.4" >> /etc/resolv.conf
62
-
63
- # Switch to non-root user
64
  USER $USER
65
  WORKDIR $HOME
66
 
67
- # Expose port 7860 for noVNC (Hugging Face Spaces default)
68
  EXPOSE $NOVNC_PORT
69
 
70
- # Start the VNC server, noVNC, and Brave
71
  CMD ["/home/appuser/scripts/start.sh"]
 
1
+ # Use Ubuntu 22.04 as the base image
2
  FROM ubuntu:22.04
3
 
4
+ # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV USER=appuser
7
  ENV HOME=/home/$USER
 
10
  ENV NOVNC_PORT=7860
11
  ENV X11VNC_LOG=/tmp/x11vnc.log
12
 
13
+ # Install dependencies
14
  RUN apt-get update && apt-get install -y \
15
  wget \
16
  gnupg \
 
35
  && rm teamviewer_amd64.deb \
36
  && rm -rf /var/lib/apt/lists/*
37
 
38
+ # Create non-root user
39
  RUN useradd -m -s /bin/bash $USER
40
 
41
+ # Fix permissions for X11
42
  RUN mkdir -p /tmp/.X11-unix \
43
  && chmod 1777 /tmp/.X11-unix \
44
  && chown $USER:$USER /tmp/.X11-unix
45
 
46
+ # Fluxbox config
47
  RUN mkdir -p $HOME/.fluxbox
48
  COPY fluxbox_menu $HOME/.fluxbox/menu
49
  RUN chown -R $USER:$USER $HOME/.fluxbox
50
 
51
+ # Setup noVNC
52
  RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
53
 
54
+ # Copy startup script
55
  RUN mkdir -p $HOME/scripts
56
  COPY start.sh $HOME/scripts/start.sh
57
  RUN chmod +x $HOME/scripts/start.sh
58
 
59
+ # Switch user
 
 
 
 
60
  USER $USER
61
  WORKDIR $HOME
62
 
63
+ # Expose noVNC port
64
  EXPOSE $NOVNC_PORT
65
 
66
+ # Start script
67
  CMD ["/home/appuser/scripts/start.sh"]