| FROM python:3.10-slim-bookworm |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| DEBIAN_FRONTEND=noninteractive \ |
| PLAYWRIGHT_BROWSERS_PATH=/app/.cache/ms-playwright |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| wget \ |
| gnupg \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN playwright install chromium |
| RUN playwright install-deps chromium |
|
|
| |
| RUN useradd -m -u 1000 user && chown -R user:user /app |
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
|
|
| |
| COPY --chown=user:user . . |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["python", "app.py"] |
|
|