24 lines
711 B
Docker
24 lines
711 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY build/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY build/app.py build/db.py ./
|
|
COPY build/static ./static
|
|
COPY build/templates ./templates
|
|
|
|
EXPOSE 5000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=5 \
|
|
CMD curl -fsS http://localhost:5000/api/health || exit 1
|
|
|
|
# gunicorn statt Flask-Devserver: mehrere Worker, robust für Dauerbetrieb
|
|
# mit ca. 40 gleichzeitig genutzten Maschinenseiten.
|
|
CMD ["gunicorn", "--workers", "4", "--threads", "2", "--timeout", "60", \
|
|
"--bind", "0.0.0.0:5000", "app:app"]
|