Files
geoip_block_generator/Dockerfile
Mateusz Gruszczyński c0afc1554d first commit
2026-02-17 09:04:09 +01:00

38 lines
758 B
Docker

FROM python:3.14-alpine
WORKDIR /app
RUN apk add --no-cache \
gcc \
musl-dev \
linux-headers \
curl
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /app/geoip_db /app/static /app/templates
ENV FLASK_HOST=0.0.0.0
ENV FLASK_PORT=5000
ENV FLASK_DEBUG=False
ENV PYTHONUNBUFFERED=1
EXPOSE ${FLASK_PORT:-5000}
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:${FLASK_PORT:-5000}/ || exit 1
CMD gunicorn --bind 0.0.0.0:${FLASK_PORT:-5000} \
--workers 1 \
--threads 8 \
--timeout 900 \
--graceful-timeout 900 \
--keep-alive 300 \
--access-logfile - \
--error-logfile - \
--log-level info \
app:app