Alvin3y1 commited on
Commit
2622d8e
·
verified ·
1 Parent(s): 8718621

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -7
Dockerfile CHANGED
@@ -32,7 +32,6 @@ RUN apt-get update && apt-get install -y \
32
  libxkbfile1 \
33
  libxtst6 \
34
  ssl-cert \
35
- # Install Perl dependencies available in 22.04
36
  libyaml-tiny-perl \
37
  libhash-merge-simple-perl \
38
  liblist-moreutils-perl \
@@ -40,16 +39,14 @@ RUN apt-get update && apt-get install -y \
40
  libdatetime-timezone-perl
41
 
42
  # 2. Fix 'libswitch-perl' Dependency (The Bulletproof Way)
43
- # We temporarily add the Ubuntu 20.04 (Focal) repo to get the missing package
44
  RUN echo "deb http://archive.ubuntu.com/ubuntu focal universe" >> /etc/apt/sources.list && \
45
  apt-get update && \
46
  apt-get install -y libswitch-perl && \
47
- # Remove the repo immediately to prevent conflicts
48
  sed -i '/focal/d' /etc/apt/sources.list && \
49
  apt-get update
50
 
51
  # 3. Install KasmVNC v1.3.1
52
- # We use this specific version because it is compatible with the configuration flags we use
53
  RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.3.1/kasmvncserver_jammy_1.3.1_amd64.deb && \
54
  apt-get install -y ./kasmvncserver_*.deb && \
55
  rm kasmvncserver_*.deb
@@ -59,15 +56,16 @@ RUN curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://br
59
  echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list && \
60
  apt-get update && apt-get install -y brave-browser
61
 
62
- # 5. Create non-root user
63
  RUN useradd -m -u 1000 user
64
  USER user
 
65
 
66
  # 6. Configure KasmVNC (Custom Landing Page)
67
  RUN mkdir -p $HOME/.vnc/www
68
  RUN echo '<html><head><title>Status</title><meta http-equiv="refresh" content="2; url=vnc.html?autoconnect=true&reconnect=true&resize=scale"></head><body style="background:black;color:white;display:flex;justify-content:center;align-items:center;height:100vh;font-family:sans-serif;"><h1>Websocket started successfully</h1></body></html>' > $HOME/.vnc/www/index.html
69
 
70
- # 7. Copy App Script
71
- COPY --chown=user app.py $HOME/app.py
72
 
73
  CMD ["python3", "app.py"]
 
32
  libxkbfile1 \
33
  libxtst6 \
34
  ssl-cert \
 
35
  libyaml-tiny-perl \
36
  libhash-merge-simple-perl \
37
  liblist-moreutils-perl \
 
39
  libdatetime-timezone-perl
40
 
41
  # 2. Fix 'libswitch-perl' Dependency (The Bulletproof Way)
42
+ # We add the focal repo temporarily to get the missing library
43
  RUN echo "deb http://archive.ubuntu.com/ubuntu focal universe" >> /etc/apt/sources.list && \
44
  apt-get update && \
45
  apt-get install -y libswitch-perl && \
 
46
  sed -i '/focal/d' /etc/apt/sources.list && \
47
  apt-get update
48
 
49
  # 3. Install KasmVNC v1.3.1
 
50
  RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.3.1/kasmvncserver_jammy_1.3.1_amd64.deb && \
51
  apt-get install -y ./kasmvncserver_*.deb && \
52
  rm kasmvncserver_*.deb
 
56
  echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list && \
57
  apt-get update && apt-get install -y brave-browser
58
 
59
+ # 5. User Setup
60
  RUN useradd -m -u 1000 user
61
  USER user
62
+ WORKDIR $HOME
63
 
64
  # 6. Configure KasmVNC (Custom Landing Page)
65
  RUN mkdir -p $HOME/.vnc/www
66
  RUN echo '<html><head><title>Status</title><meta http-equiv="refresh" content="2; url=vnc.html?autoconnect=true&reconnect=true&resize=scale"></head><body style="background:black;color:white;display:flex;justify-content:center;align-items:center;height:100vh;font-family:sans-serif;"><h1>Websocket started successfully</h1></body></html>' > $HOME/.vnc/www/index.html
67
 
68
+ # 7. Copy App Script (Explicitly copying to current WORKDIR)
69
+ COPY --chown=user app.py .
70
 
71
  CMD ["python3", "app.py"]