GRI-1855: server Docker/Compose image and systemd unit packaging (#26) #91

Merged
vivy merged 1 commit from feature/GRI-1855-server-packaging into dev 2026-11-09 20:08:18 +00:00
Member

Forge #26: one install path for the server — systemd unit and container, both.

What's in this PR

  • packaging/server/Dockerfile — multi-stage build, pinned RUST_VERSION build arg, runs as an unprivileged system user in debian:bookworm-slim.
  • packaging/server/docker-compose.yml — the server plus a postgres:16 it owns (the version this fleet already standardizes on, e.g. grimoire-of-helpdesk's CI), health-gated so the server never starts racing an unready database, named volumes for the database, the media directory and the signing key.
  • packaging/server/config.toml.example, shared by both packaging paths.
  • scripts/package-server-image.sh — reads RUST_VERSION out of rust-toolchain.toml (one source of truth, same rule as everywhere else) and builds/tags the image; appends (never overwrites) its one .env line so it never clobbers POSTGRES_PASSWORD already there.
  • packaging/server-systemd/grimoirix-signage-server.service + README.md — the plain-binary path, DynamicUser=yes so install needs no useradd step.
  • plan/operations/deployment.md updated with what's built and what isn't.

Verified on this build host

  • Release binary built; ran it directly against config.toml.example (with the placeholder filled in) — /health answers 200 {"status":"ok"}.
  • docker compose config renders the Compose file to the expected services/volumes/build-args (doesn't need the daemon).
  • systemd-analyze verify passes the unit clean against the built binary.
  • package-server-image.sh's version-extraction and .env upsert logic, run directly: RUST_VERSION=1.99.0 matches rust-toolchain.toml, and a pre-existing POSTGRES_PASSWORD= line survives a rerun.
  • ./scripts/local-gates.sh — every gate passed.
  • repo-boundary --staged — clean.

Not verified, and said so in deployment.md

An actual docker build/docker compose up. This account (forgemother) has no membership in this host's docker group, so every docker command that talks to the daemon returns permission denied here — confirmed, not guessed. I've flagged it to Aetherius (accounts/host capacity) to grant it, same boundary as everything else that touches the machine under the runner. Until then this is the same shape as GRI-1855's .deb PR noting "not verified: real hardware": the static checks above are what this host can measure.

Also not yet true of either path: the server binary doesn't open a database connection at all yet — forge #9 (Postgres wiring/migrations) is still open, PR #82 still in conflict. Both packaging paths bring up a server next to a correctly-versioned Postgres; neither proves the server actually uses it yet. Nothing here needs to change when #9 lands — the db service and SIGNAGE_DATABASE_URL/database.url wiring are already in place.

Next

Forge #9/#82 (Postgres wiring) landing is what finishes deployment.md's "clean machine install" acceptance criterion for #26. I'll keep this PR to packaging mechanism, which is what's askable now.

Forge [#26](https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/26): one install path for the server — systemd unit and container, both. ## What's in this PR - `packaging/server/Dockerfile` — multi-stage build, pinned `RUST_VERSION` build arg, runs as an unprivileged system user in `debian:bookworm-slim`. - `packaging/server/docker-compose.yml` — the server plus a `postgres:16` it owns (the version this fleet already standardizes on, e.g. `grimoire-of-helpdesk`'s CI), health-gated so the server never starts racing an unready database, named volumes for the database, the media directory and the signing key. - `packaging/server/config.toml.example`, shared by both packaging paths. - `scripts/package-server-image.sh` — reads `RUST_VERSION` out of `rust-toolchain.toml` (one source of truth, same rule as everywhere else) and builds/tags the image; appends (never overwrites) its one `.env` line so it never clobbers `POSTGRES_PASSWORD` already there. - `packaging/server-systemd/grimoirix-signage-server.service` + `README.md` — the plain-binary path, `DynamicUser=yes` so install needs no `useradd` step. - `plan/operations/deployment.md` updated with what's built and what isn't. ## Verified on this build host - Release binary built; ran it directly against `config.toml.example` (with the placeholder filled in) — `/health` answers `200 {"status":"ok"}`. - `docker compose config` renders the Compose file to the expected services/volumes/build-args (doesn't need the daemon). - `systemd-analyze verify` passes the unit clean against the built binary. - `package-server-image.sh`'s version-extraction and `.env` upsert logic, run directly: `RUST_VERSION=1.99.0` matches `rust-toolchain.toml`, and a pre-existing `POSTGRES_PASSWORD=` line survives a rerun. - `./scripts/local-gates.sh` — every gate passed. - `repo-boundary --staged` — clean. ## Not verified, and said so in `deployment.md` An actual `docker build`/`docker compose up`. This account (`forgemother`) has no membership in this host's `docker` group, so every `docker` command that talks to the daemon returns `permission denied` here — confirmed, not guessed. I've flagged it to Aetherius (accounts/host capacity) to grant it, same boundary as everything else that touches the machine under the runner. Until then this is the same shape as GRI-1855's `.deb` PR noting "not verified: real hardware": the static checks above are what this host can measure. Also not yet true of either path: the server binary doesn't open a database connection at all yet — forge [#9](https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/9) (Postgres wiring/migrations) is still open, PR #82 still in conflict. Both packaging paths bring up a server next to a correctly-versioned Postgres; neither proves the server actually uses it yet. Nothing here needs to change when #9 lands — the `db` service and `SIGNAGE_DATABASE_URL`/`database.url` wiring are already in place. ## Next Forge #9/#82 (Postgres wiring) landing is what finishes `deployment.md`'s "clean machine install" acceptance criterion for #26. I'll keep this PR to packaging mechanism, which is what's askable now.
GRI-1855: server Docker/Compose image and systemd unit packaging (#26)
Some checks failed
CI / the pre-push hook (pull_request) Successful in 6s
CI / cargo fmt (pull_request) Successful in 6s
CI / cargo deny (pull_request) Successful in 44s
CI / cargo deny advisories (pull_request) Failing after 40s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 10m2s
CI / cargo test (pull_request) Successful in 10m0s
CI / frontend-web (pull_request) Successful in 9m35s
CI / CI (pull_request) Successful in 3s
CI / Notify gate failed (pull_request) Has been skipped
54139441a1
vivy merged commit e17d343a55 into dev 2026-11-09 20:08:18 +00:00
vivy deleted branch feature/GRI-1855-server-packaging 2026-11-09 20:08:18 +00: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
Grimoirix/grimoire-of-digital-signage!91
No description provided.