| FROM python:3.9-slim | |
| # Install system dependencies for pygame | |
| RUN apt-get update && apt-get install -y \ | |
| libsdl2-mixer-2.0-0 \ | |
| libsdl2-image-2.0-0 \ | |
| libsdl2-2.0-0 \ | |
| libsdl2-ttf-2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy requirements first | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application | |
| COPY best.py app.py # Rename best.py to app.py for clarity | |
| COPY sound.mp3 . # If you have a sound file | |
| # Hugging Face uses port 7860 | |
| ENV PORT=7860 | |
| # Run the application | |
| CMD ["python", "app.py"] |