| FROM python:3.9 | |
| # Install OpenGL dependencies and Xvfb | |
| RUN apt-get update && \ | |
| apt-get install -y libgl1-mesa-glx libgl1-mesa-dev xvfb | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the app.py script to the working directory | |
| COPY app.py . | |
| # Install the required Python dependencies | |
| RUN pip install pyglet arcade pygame | |
| # Set the display environment variable | |
| ENV DISPLAY=:99 | |
| # Run Xvfb and the app.py script when the container starts | |
| CMD Xvfb :99 & python app.py |