Spaces:
Paused
Paused
Create Dockerfile
Browse files123456789101112131415161718192021222324252627282930313233343536# Base image with Python 3.9FROM python:3.9
# Create a new user and switch to that userRUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"
# Set working directoryWORKDIR /app
# Copy and install Python dependencies (if needed)COPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt
# Install additional dependencies for running a lightweight browserUSER rootRUN apt-get update && \ apt-get install -y --no-install-recommends \ midori \ xvfb \ x11vnc \ && rm -rf /var/lib/apt/lists/*
# Set up VNC passwordRUN mkdir -p /home/user/.vnc && \ echo "1234" | vncpasswd -f > /home/user/.vnc/passwd && \ chown -R user:user /home/user/.vnc && \ chmod 600 /home/user/.vnc/passwd
# Switch back to the userUSER user
# Start the browser (Midori) with a virtual display and VNCCMD xvfb-run -s "-screen 0 1024x768x16" x11vnc -forever -usepw -create & \ midoriDockerfileAdded+36