Files
PunktFri/Dockerfile
Henrik Jess Nielsen 5fc893755f
All checks were successful
Build and Deploy PunktFri / build-and-deploy (push) Successful in 47s
Gunicorn: log to stdout/stderr + preload for crash visibility
- --access-logfile - : access logs to stdout (visible in Nomad)
- --error-logfile -  : error logs to stderr (visible in Nomad)
- --log-level info   : show startup and worker events
- --preload          : load app before forking workers — crashes
                       surface immediately instead of silently dying
2026-04-28 21:46:57 +02:00

30 lines
678 B
Docker

FROM python:3.12-slim
ARG BUILD_VERSION=dev
ARG GIT_COMMIT=unknown
ARG BUILD_TIME=unknown
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=app.py \
BUILD_VERSION=${BUILD_VERSION} \
GIT_COMMIT=${GIT_COMMIT} \
BUILD_TIME=${BUILD_TIME} \
PORT=5000 \
HOST=0.0.0.0 \
DATABASE=/app/instance/punktfri.db \
LOG_FILE=/app/instance/signups.log
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /app/instance
EXPOSE 5000
CMD ["sh", "-c", "gunicorn --bind ${HOST}:${PORT} --workers 2 --timeout 60 --access-logfile - --error-logfile - --log-level info --preload app:app"]