FROM python:3.12-slim

# Only optional deps (see README) — the app itself is stdlib only.
RUN pip install --no-cache-dir anthropic pillow

WORKDIR /app
COPY app.py cardimage.py store.py vision.py ./
COPY static/ ./static/

# grades.db lives here; mount a volume at /data to persist it across
# container recreates and image updates.
ENV CARD_GRADER_DB_PATH=/data/grades.db
ENV PORT=8778
EXPOSE 8778

CMD ["python3", "app.py"]
