| FROM python:3.11-slim-bullseye |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| xvfb \ |
| x11-utils \ |
| x11-xserver-utils \ |
| xdotool \ |
| dbus-x11 \ |
| plasma-desktop \ |
| kwin-x11 \ |
| build-essential \ |
| pkg-config \ |
| python3-dev \ |
| libffi-dev \ |
| libx11-dev \ |
| libxrandr2 \ |
| libxtst6 \ |
| libxext-dev \ |
| libxrender-dev \ |
| libturbojpeg0 \ |
| curl \ |
| wget \ |
| procps \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| DISPLAY=:99 |
|
|
| WORKDIR $HOME/app |
|
|
| |
| |
| COPY --chown=user:user requirements.txt . |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY --chown=user:user app.py . |
|
|
| EXPOSE 7860 |
|
|
| CMD ["python", "app.py"] |