Files
plm-lottery/Dockerfile
T
davideandClaude Sonnet 5 6c51a81f0e Fail loud at startup if the master key is missing
Previously a missing master.xprv.enc only surfaced as a 500 on the
first register call, with a stack trace that didn't say what to do
about it. Check for the file before alembic/uvicorn start and exit 1
with the exact generate_master_key.py command to run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 18:46:19 +02:00

16 lines
478 B
Docker

FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml ./
COPY app ./app
COPY migrations ./migrations
COPY alembic.ini ./
COPY scripts ./scripts
RUN pip install --no-cache-dir .
EXPOSE 8123
CMD ["/bin/sh", "-c", "test -f \"$MASTER_KEY_PATH\" || { echo \"ERROR: master key not found at $MASTER_KEY_PATH -- run: docker compose run --rm app python scripts/generate_master_key.py\" >&2; exit 1; }; alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8123"]