Skip to content

Containers & volumes

Image Base Exposes Starts
api Node 22 Alpine 3000 npm start
web Node 22 Alpine 3001 node build

The web image builds the SvelteKit app during the image build and runs node build as its production entrypoint. Its hooks.server.ts proxies /api to the API service, which keeps the browser same-origin — so there is no CORS configuration anywhere in the stack.

The API reads and writes SQLCipher-encrypted files under /data on a mounted volume. Image builds and pulls therefore never carry database state with them — pulling a new tag cannot clobber your data, which is exactly what makes docker compose up -d a safe upgrade.

/data
├── registry.db # email → family routing, app settings
├── db/<familyId>.db # one encrypted file per family
└── blobs/ # uploads (not encrypted at rest)

api/Dockerfile copies only source (src, tsconfig.json, manifests) and never data/ or any *.db.

A root .dockerignore excludes data/, **/*.db*, node_modules/, .git/ and .env* from every build context. Local development data cannot reach a build daemon or be baked into an image, regardless of which Compose file or docker build invocation you use.

File Data location Use
docker-compose.yml (root) ./data bind mount Development — data as plain, inspectable host files
deploy/docker-compose/docker-compose.yml nido-data named volume Single-host deployment

The root file bind-mounts the host folder so the databases and blobs live as ordinary files you can inspect and back up with tar. The deploy file uses a named volume, which needs a docker run --rm -v … incantation to archive.

Both require NIDO_MASTER_KEY and JWT_SECRET; the deploy file enforces it in the Compose variable interpolation so it fails before building anything.

To discard everything and begin again, reset the storage layer.

Terminal window
# named volume
docker compose down -v
# bind mount
docker compose down && rm -rf ./data

CI publishes to GHCR for releases, merges to main, and pull requests:

Tag Published when Pinned or floating
v<date> A release is cut from main Pinned — use this
latest A release is cut Floating — moves to the newest release
main A merge lands on main Floating — unreleased code
sha-<commit> Every build Pinned — one commit, exactly
dev A pull request is pushed to Floating — newest PR build
ghcr.io/stewartshea/nido/{api,web}:v2026.10.26
ghcr.io/stewartshea/nido/{api,web}:latest
ghcr.io/stewartshea/nido/{api,web}:main
ghcr.io/stewartshea/nido/{api,web}:sha-<commit>
ghcr.io/stewartshea/nido/{api,web}:dev

Deployments should pin a v<date> tag: a floating tag is resolved when a pod is created, so it does not roll anything on its own. Releases explains what cutting one does, including how the hosted instance is pinned to it.

dev builds a pull request so it can be tried before it merges. There is one dev tag per service, shared by every open pull request, so the most recent build wins; use the sha-<commit> tag to say which commit you actually pulled.

Per-commit tags are worth knowing about: they are what makes rollbacking an upgrade pin to exactly the commit that was running before, rather than to a vague “previous release”.