Update Dockerfile
Browse files1234567810 unmodified lines1920212223242526272829303132333435# 1. Start with the Python Base ImageFROM python:3.10-slim# 2. Install System Dependencies# Note: We use \ to break lines. Do not put comments # inside the command.RUN apt-get update && apt-get install -y \wget \gnupg \10 unmodified lineschromium-driver \&& rm -rf /var/lib/apt/lists/*# 3. Set environment variablesENV DISPLAY=:99ENV PYTHONUNBUFFERED=1# 4. Setup WorkspaceWORKDIR /appCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# 5. Copy your codeCOPY . .# 6. Start Virtual Screen and your AppCMD ["sh", "-c", "Xvfb :99 -screen 0 1280x720x24 & python app.py"]123456710 unmodified lines181920212223242526272829303132333435363738394041# 1. Base ImageFROM python:3.10-slim# 2. Install System Dependencies (Fixes for Debian Trixie)RUN apt-get update && apt-get install -y \wget \gnupg \10 unmodified lineschromium-driver \&& rm -rf /var/lib/apt/lists/*# 3. Environment Setup# We force the display to 99 so the bot can "see" without a monitorENV DISPLAY=:99ENV PYTHONUNBUFFERED=1WORKDIR /app# 4. Install Python RequirementsCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# 5. Copy App CodeCOPY . .# 6. EXPOSE the Port# This tells Hugging Face that port 7860 is where the website livesEXPOSE 7860# 7. The Launch Command# We start the Virtual Screen (Xvfb) first, then run the Python appCMD ["sh", "-c", "Xvfb :99 -screen 0 1280x720x24 & python app.py"]
Dockerfile+13-7