# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml /app/
RUN pip install --no-cache-dir .
COPY app /app/app
RUN mkdir -p /data && chmod 700 /data
ENV DATA_DIR=/data
EXPOSE 8080
# Single-process assumption: per-user sync locking and the in-process
# scheduler both live in this one worker's memory. Do not scale this to
# multiple uvicorn workers or container replicas without adding a
# cross-process lock -- otherwise duplicate imports become possible.
CMD ["uvicorn", "app.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8080"]
