| FROM python:3.11-slim-bookworm |
|
|
| |
| |
| |
| RUN apt-get update && apt-get install -y \ |
| xvfb \ |
| fluxbox \ |
| xdotool \ |
| wget \ |
| curl \ |
| gnupg \ |
| procps \ |
| libx11-6 \ |
| libxtst6 \ |
| libxext6 \ |
| libxrender1 \ |
| libxi6 \ |
| |
| libnss3 \ |
| libatk1.0-0 \ |
| libatk-bridge2.0-0 \ |
| libcups2 \ |
| libdrm2 \ |
| libgbm1 \ |
| libasound2 \ |
| libpangocairo-1.0-0 \ |
| libgtk-3-0 \ |
| fonts-liberation \ |
| xdg-utils \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor -o /usr/share/keyrings/opera-browser-keyring.gpg && \ |
| echo "deb [signed-by=/usr/share/keyrings/opera-browser-keyring.gpg] https://deb.opera.com/opera-stable/ stable non-free" \ |
| | tee /etc/apt/sources.list.d/opera-stable.list && \ |
| apt-get update && \ |
| apt-get install -y opera-stable |
|
|
| # 3. Setup User |
| RUN useradd -m -u 1000 user |
| WORKDIR /home/user/app |
|
|
| # 4. Install Python Libraries |
| RUN pip3 install --no-cache-dir \ |
| aiortc \ |
| aiohttp \ |
| mss \ |
| numpy \ |
| pillow \ |
| python-xlib \ |
| uvloop |
|
|
| # 5. Finalize Setup |
| COPY --chown=user:user . . |
| USER user |
|
|
| ENV DISPLAY=:99 |
| ENV PYTHONUNBUFFERED=1 |
|
|
| EXPOSE 7860 |
|
|
| CMD ["python3", "app.py"] |