# syntax=docker/dockerfile:1

FROM python:3.12-slim AS runtime
WORKDIR /app

RUN pip install --no-cache-dir --upgrade pip

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# The SQLite database lives outside the container - see docker-compose.yml volumes.
VOLUME ["/app/data"]

ENV TELCO_DATA_DIR=/app/data
ENV PORT=8000
EXPOSE 8000

CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "app:app"]
