Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Prevent python from buffering stdout/stderr | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PORT=7860 | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| COPY requirements.txt /app/ | |
| RUN pip install -r requirements.txt | |
| RUN playwright install-deps chromium | |
| COPY --chown=user:user . /app | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| RUN playwright install chromium | |
| # Expose the port used by Spaces | |
| EXPOSE 7860 | |
| # 1) Generate config files from secrets | |
| # 2) Launch the Flask app with gunicorn | |
| CMD bash -lc "python startup.py && gunicorn -w 2 -k gthread -b 0.0.0.0:${PORT} wsgi:app" | |