SalHargis commited on
Commit
14ef2c5
·
verified ·
1 Parent(s): 78a7df4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
- FROM python:3.9
 
2
 
3
  # 1. Install system dependencies
4
  RUN apt-get update && apt-get install -y \
@@ -11,14 +12,14 @@ RUN apt-get update && apt-get install -y \
11
  scrot \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # 2. Fix the 403 Error: Create an index.html so the page loads
15
- # We link the NoVNC viewer to the default index page
16
  RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
17
 
18
  # 3. Set up work directory
19
  WORKDIR /app
20
 
21
- # 4. Copy files
22
  COPY . .
23
 
24
  # 5. Install Python requirements
@@ -27,8 +28,7 @@ RUN pip install --no-cache-dir -r requirements.txt
27
  # 6. Create the user
28
  RUN useradd -m -u 1000 user
29
 
30
- # 7. GENERATE THE STARTUP SCRIPT MANUALLY
31
- # We write the script here to avoid all permission/line-ending issues
32
  RUN echo '#!/bin/bash' > start.sh && \
33
  echo 'export DISPLAY=:1' >> start.sh && \
34
  echo 'Xvfb :1 -screen 0 1440x960x24 &' >> start.sh && \
@@ -39,7 +39,7 @@ RUN echo '#!/bin/bash' > start.sh && \
39
  echo '/usr/share/novnc/utils/launch.sh --vnc localhost:5900 --listen 7860' >> start.sh && \
40
  chmod +x start.sh
41
 
42
- # 8. Fix permissions for the user
43
  RUN chown -R user:user /app
44
 
45
  # 9. Switch to user and run
 
1
+ # USE SPECIFIC VERSION (Fixes the missing file crash)
2
+ FROM python:3.9-bullseye
3
 
4
  # 1. Install system dependencies
5
  RUN apt-get update && apt-get install -y \
 
12
  scrot \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # 2. Fix the 403 Error (Missing Index)
16
+ # Force NoVNC to show the viewer by default
17
  RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
18
 
19
  # 3. Set up work directory
20
  WORKDIR /app
21
 
22
+ # 4. Copy your python files
23
  COPY . .
24
 
25
  # 5. Install Python requirements
 
28
  # 6. Create the user
29
  RUN useradd -m -u 1000 user
30
 
31
+ # 7. GENERATE STARTUP SCRIPT (Fixes permissions & line endings)
 
32
  RUN echo '#!/bin/bash' > start.sh && \
33
  echo 'export DISPLAY=:1' >> start.sh && \
34
  echo 'Xvfb :1 -screen 0 1440x960x24 &' >> start.sh && \
 
39
  echo '/usr/share/novnc/utils/launch.sh --vnc localhost:5900 --listen 7860' >> start.sh && \
40
  chmod +x start.sh
41
 
42
+ # 8. Transfer ownership to user
43
  RUN chown -R user:user /app
44
 
45
  # 9. Switch to user and run