FROM docker.io/library/python:3.12-slim RUN apt-get update \ && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Download the full scunpacked dataset (~83 MB) at build time so the image # is self-contained; DATA_DIR points the API at it. RUN python scripts/fetch_data.py --output-dir /app/data/full ENV DATA_DIR=/app/data/full RUN useradd --create-home appuser \ && chown -R appuser:appuser /app USER appuser EXPOSE 8000 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]