14 lines
691 B
Docker
14 lines
691 B
Docker
FROM python:3.12.11-slim
|
|
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
|
WORKDIR /app
|
|
RUN addgroup --system app && adduser --system --ingroup app app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY app ./app
|
|
COPY THIRD_PARTY_NOTICES.md ./THIRD_PARTY_NOTICES.md
|
|
RUN test -s /app/app/static/favicon.ico && test -s /app/THIRD_PARTY_NOTICES.md
|
|
USER app
|
|
EXPOSE 5000
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/health', timeout=2)"]
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "8", "--timeout", "30", "app.web:app"]
|