Spaces:
Paused
Paused
| FROM python:3.11-slim | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| XDG_CACHE_HOME=/home/user/.cache \ | |
| PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright \ | |
| PORT=7860 \ | |
| HOST=0.0.0.0 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| xvfb \ | |
| curl \ | |
| ca-certificates \ | |
| fonts-liberation \ | |
| libasound2 \ | |
| libatk-bridge2.0-0 \ | |
| libatk1.0-0 \ | |
| libc6 \ | |
| libcairo2 \ | |
| libcups2 \ | |
| libdbus-1-3 \ | |
| libdrm2 \ | |
| libexpat1 \ | |
| libfontconfig1 \ | |
| libgbm1 \ | |
| libgcc1 \ | |
| libglib2.0-0 \ | |
| libgtk-3-0 \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libpango-1.0-0 \ | |
| libpangocairo-1.0-0 \ | |
| libstdc++6 \ | |
| libx11-6 \ | |
| libx11-xcb1 \ | |
| libxcb1 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libxrender1 \ | |
| libxshmfence1 \ | |
| libxkbcommon0 \ | |
| libxss1 \ | |
| libxtst6 \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user && \ | |
| mkdir -p /home/user/.cache/ms-playwright /home/user/app && \ | |
| chown -R user:user /home/user | |
| WORKDIR /home/user/app | |
| COPY --chown=user:user requirements.txt ./requirements.txt | |
| USER user | |
| RUN python -m pip install --upgrade pip && \ | |
| python -m pip install -r requirements.txt && \ | |
| python -m pip install pyvirtualdisplay && \ | |
| python -m playwright install chromium | |
| COPY --chown=user:user . /home/user/app | |
| EXPOSE 7860 | |
| CMD ["python", "server.py"] |