browsertrix/backend/Dockerfile
Ilya Kreymer 90197b2a85
Backend mem usage fix - use fixed MOTOR_MAX_WORKERS + switch to gunicorn (#1468)
Refactors backend deployment to:
- Use MOTOR_MAX_WORKERS (defaulting to 1) to reduce threads used by
mongodb connections
- Also sets backend workers to 1 by default to reduce default memory
usage
- Switches to gunicorn with uvloop worker for production use instead of
uvicorn (as recommended by uvicorn)

Lower thread count should address memory leak/increased usage, which
resulted in 5x thread x cpus x workers, eg. potentially 20 or 40 threads
just for mongodb connections. Lower default number of workers should
make it easier to scale backend with HPA if additional capacity.

Fixes #1467
2024-01-16 15:32:42 -08:00

12 lines
165 B
Docker

FROM docker.io/library/python:3.10-slim
WORKDIR /app
ADD requirements.txt /app
RUN pip install -r requirements.txt
ADD btrixcloud/ /app/btrixcloud/
EXPOSE 8000