Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
19 lines
526 B
Docker
19 lines
526 B
Docker
# ROOT_PATH: Caddy strips /py, so --root-path is what makes /py/docs work.
|
|
# sh -c so ${PYTHON_PORT} and ${ROOT_PATH} expand at runtime.
|
|
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app ./app
|
|
|
|
EXPOSE 8000
|
|
|
|
# PYTHON_PORT and ROOT_PATH are supplied by docker compose (defaults below).
|
|
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path ${ROOT_PATH:-/py}"]
|