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>
16 lines
478 B
Docker
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"]
|