FROM python:3.12-slim

WORKDIR /app

RUN pip install --no-cache-dir "fastapi>=0.140.0" "uvicorn>=0.51.0" "pydantic>=2.9"

COPY app.py /app/app.py

EXPOSE 8080

# Single worker on purpose: task state lives in process memory, and the reset
# endpoint has to clear the same memory every request sees.
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "1"]
