Provide kataba as a Docker image (#49) #50

Merged
miko merged 1 commit from feature/49-docker-image into development 2026-11-02 20:04:14 +01:00
Owner

Closes #49.

  • Multi-stage Dockerfile (Debian slim, Node 26) from the Next.js standalone output; runs as node, uploads in a volume at /data/uploads.
  • The entrypoint runs prisma migrate deploy before the server starts (KATABA_SKIP_MIGRATIONS=1 turns it off). The Prisma CLI lives in /opt/migrate, pinned to the lockfile's version.
  • docker/compose.yaml + docker/.env.example: kataba with MariaDB 11.8; Authentik stays external.
  • Standalone output is only on in the image build (KATABA_STANDALONE=1); local npm run build / next start / e2e are unchanged.
  • Settings in a build without a database: the root layout bakes the settings into the prerendered shells. The image is built without a database, so loadSettings returns the defaults with a 1 s revalidation; the first request at runtime regenerates the shells with the stored settings. Documented in ADR-0014.
  • README section "Running with Docker"; Docker removed from the "not in v1" lists.

Tested

  • Image builds; docker compose up against a fresh MariaDB applies all migrations and serves the home page as a guest.
  • With instanceName and accentColor stored in the database, the title and accent are correct from the first requests after container start.
  • Uploads volume is writable by the node user.
  • Local: lint, typecheck, 272 unit tests, regular npm run build (no standalone, shells revalidate after 15 min as before).
  • Not tested in the container: sign-in via Authentik and image uploads.

🤖 Generated with Claude Code

Closes #49. - Multi-stage `Dockerfile` (Debian slim, Node 26) from the Next.js standalone output; runs as `node`, uploads in a volume at `/data/uploads`. - The entrypoint runs `prisma migrate deploy` before the server starts (`KATABA_SKIP_MIGRATIONS=1` turns it off). The Prisma CLI lives in `/opt/migrate`, pinned to the lockfile's version. - `docker/compose.yaml` + `docker/.env.example`: kataba with MariaDB 11.8; Authentik stays external. - Standalone output is only on in the image build (`KATABA_STANDALONE=1`); local `npm run build` / `next start` / e2e are unchanged. - **Settings in a build without a database:** the root layout bakes the settings into the prerendered shells. The image is built without a database, so `loadSettings` returns the defaults with a 1 s revalidation; the first request at runtime regenerates the shells with the stored settings. Documented in ADR-0014. - README section "Running with Docker"; Docker removed from the "not in v1" lists. ## Tested - Image builds; `docker compose up` against a fresh MariaDB applies all migrations and serves the home page as a guest. - With `instanceName` and `accentColor` stored in the database, the title and accent are correct from the first requests after container start. - Uploads volume is writable by the `node` user. - Local: lint, typecheck, 272 unit tests, regular `npm run build` (no standalone, shells revalidate after 15 min as before). - Not tested in the container: sign-in via Authentik and image uploads. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A multi-stage Dockerfile builds one generic image from the Next.js
standalone output; the container applies pending migrations on start
and keeps uploads in a volume. docker/ holds a Compose example with
MariaDB. Local development stays on the host, so standalone output is
only switched on in the image build.

The image is built without a database, so the settings baked into the
prerendered shells are the defaults, marked stale at once: the first
request at runtime regenerates the shells with the stored settings
(ADR-0014).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 4179cdfbfa into development 2026-11-02 20:04:14 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!50
No description provided.