20 lines
599 B
Docker
20 lines
599 B
Docker
FROM docker.io/library/python:3.12-slim AS base
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# GeoLite2 City database for IP geolocation
|
|
# Download from https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
|
|
# and place at backend/geo/GeoLite2-City.mmdb before building
|
|
RUN mkdir -p /app/geo
|
|
COPY geo/GeoLite2-City.mmdb /app/geo/GeoLite2-City.mmdb 2>/dev/null || true
|
|
|
|
EXPOSE 8000
|
|
CMD ["gunicorn", "app.main:app", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000", "--workers", "2", "--timeout", "120"]
|