Spaces:
Sleeping
Sleeping
| # Base image | |
| FROM python:3.10-slim | |
| # Prevent interactive prompts | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install system dependencies for Tkinter + virtual display | |
| RUN apt-get update && apt-get install -y \ | |
| python3-tk \ | |
| xvfb \ | |
| xauth \ | |
| x11-apps \ | |
| libx11-6 \ | |
| libgtk-3-0 \ | |
| && apt-get clean | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy project files | |
| COPY . /app | |
| # Install Python dependencies (if any) | |
| RUN pip install --no-cache-dir -r requirements.txt || true | |
| # Expose port (required for Hugging Face Spaces) | |
| EXPOSE 7860 | |
| # Start app using virtual display (Xvfb) | |
| CMD ["bash", "-c", "Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 && python app.py"] |