Spaces:
Paused
Paused
Update Dockerfile
Browse files12346 unmodified lines11121314151617181920212223242 unmodified lines27282930313233344 unmodified lines39404142434445FROM python:3.9# 1. Install system dependenciesRUN apt-get update && apt-get install -y \6 unmodified linesscrot \&& rm -rf /var/lib/apt/lists/*# 2. Fix the 403 Error: Create an index.html so the page loads# We link the NoVNC viewer to the default index pageRUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html# 3. Set up work directoryWORKDIR /app# 4. Copy filesCOPY . .# 5. Install Python requirements2 unmodified lines# 6. Create the userRUN useradd -m -u 1000 user# 7. GENERATE THE STARTUP SCRIPT MANUALLY# We write the script here to avoid all permission/line-ending issuesRUN echo '#!/bin/bash' > start.sh && \echo 'export DISPLAY=:1' >> start.sh && \echo 'Xvfb :1 -screen 0 1440x960x24 &' >> start.sh && \4 unmodified linesecho '/usr/share/novnc/utils/launch.sh --vnc localhost:5900 --listen 7860' >> start.sh && \chmod +x start.sh# 8. Fix permissions for the userRUN chown -R user:user /app# 9. Switch to user and run123456 unmodified lines12131415161718192021222324252 unmodified lines282930313233344 unmodified lines39404142434445# USE SPECIFIC VERSION (Fixes the missing file crash)FROM python:3.9-bullseye# 1. Install system dependenciesRUN apt-get update && apt-get install -y \6 unmodified linesscrot \&& rm -rf /var/lib/apt/lists/*# 2. Fix the 403 Error (Missing Index)# Force NoVNC to show the viewer by defaultRUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html# 3. Set up work directoryWORKDIR /app# 4. Copy your python filesCOPY . .# 5. Install Python requirements2 unmodified lines# 6. Create the userRUN useradd -m -u 1000 user# 7. GENERATE STARTUP SCRIPT (Fixes permissions & line endings)RUN echo '#!/bin/bash' > start.sh && \echo 'export DISPLAY=:1' >> start.sh && \echo 'Xvfb :1 -screen 0 1440x960x24 &' >> start.sh && \4 unmodified linesecho '/usr/share/novnc/utils/launch.sh --vnc localhost:5900 --listen 7860' >> start.sh && \chmod +x start.sh# 8. Transfer ownership to userRUN chown -R user:user /app# 9. Switch to user and run
Dockerfile+7-7