File size: 770 Bytes
ff911ff
 
e2850f1
15baf6b
0a894f4
 
 
15baf6b
ff911ff
e2850f1
 
0a894f4
 
 
 
 
 
ff911ff
0a894f4
 
ff911ff
0a894f4
ff911ff
afe79e9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM python:3.10-slim

USER root
RUN apt-get update && apt-get install -y \
    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/*

RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    DISPLAY=:99 \
    PYTHONUNBUFFERED=1

WORKDIR $HOME/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user . .

# Added -extension to Xvfb to help with rendering game elements
CMD ["sh", "-c", "Xvfb :99 -screen 0 1280x720x24 -ac +extension GLX +render -noreset & python app.py"]