feat(docker): Dockerfile + entrypoint for home-ctr-onyx image (#28) #32
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/dockerfile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #28. Unblocks #29 (compose.yml) and #30 (Forgejo Actions deploy).
Summary
Dockerfileat repo root:python:3.12-slim-bookworm, uv pinned at0.5.11viaghcr.io/astral-sh/uv,uv sync --no-dev --frozenintwo layers for cache friendliness,
USER 1000:1000,EXPOSE 8000,HEALTHCHECKagainst/healthzusingpython -c+urllib(python-slim has no curl).
docker/entrypoint.sh: runsalembic upgrade head(the pre-upgradebackup hook in
alembic/env.pyfires automatically), thenexec uvicorn quartermaster.main:app --host 0.0.0.0 --port 8000 --log-config src/quartermaster/logconfig.jsonso access + errorlogs land on stdout as JSON.
execmakes uvicorn PID 1 for signalhandling.
.dockerignore: trims context (keepsREADME.mdbecause hatchlingreads it when installing the local project).
docker build/docker runpair that uses a bind-mounted tempdirand a
sqlite:////data/qm.dbDB URL.Test plan
docker build -t quartermaster:dev .succeeds on a clean contextdocker runwith-v /tmp/qm-data:/dataandQUARTERMASTER_DB_URL=sqlite:////data/qm.dbstarts cleanly;alembic runs all five migrations
curl http://127.0.0.1:8000/healthzreturns{"status":"ok"}docker inspectreportsHealth.Status = healthyuid=1000 gid=1000logconfig.jsonhonored)
1000:1000