Update Dockerfile
Browse files112344567891011121314151617186789102122232411121314151617182619202829212223243233252627353637383940412829# 1. Base Image# Use a Python base with high compatibilityFROM python:3.10-slim
# 2. Install System Dependencies (Fixes for Debian Trixie)# Install system dependencies for Chromium, Xvfb, and OpenGL (for game rendering)RUN apt-get update && apt-get install -y \ wget \ gnupg \ unzip \ xvfb \ libgl1 \ libglx-mesa0 \ libnss3 \ libxss1 \ libasound2 \ libatk-bridge2.0-0 \ libgtk-3-0 \ chromium \ chromium-driver \ wget gnupg unzip xvfb libgl1-mesa-dri libglapi-mesa libosmesa6 \ libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 \ chromium chromium-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=1# Create a non-root user for Hugging Face SpacesRUN useradd -m -u 1000 userUSER userENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ DISPLAY=:99 \ PYTHONUNBUFFERED=1
WORKDIR /appWORKDIR $HOME/app
# 4. Install Python RequirementsCOPY requirements.txt .# Install Python requirementsCOPY --chown=user requirements.txt .RUN pip install --no-cache-dir -r requirements.txt
# 5. Copy App CodeCOPY . .# Copy the rest of the applicationCOPY --chown=user . .
# 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"]# Launch: Start Xvfb (Virtual Screen) then the Python AppCMD ["sh", "-c", "Xvfb :99 -ac -screen 0 1280x720x24 & python app.py"]Dockerfile+19-31