feat(deploy): Docker Compose setup for one host #140

Merged
Sebi merged 1 commits from feat/compose into main 2026-11-23 20:54:14 +00:00
Owner

deploy/compose/compose.yaml + .env.example

  • migrate (one-shot api migrate up) → api starts only after it completed; API healthcheck via the new api health command (distroless image, no shell).
  • Profiles in COMPOSE_PROFILES: db (TimescaleDB, volume, pg_isready), redis (password, AOF on a volume), checker, statuspage (port, cache volume). Without db/redis, UPTIME_DATABASE_URL / UPTIME_REDIS_URL point to your own; depends_on … required: false keeps that working.
  • Only UPTIME_PUBLIC_URL and UPTIME_SECRET_KEYS are mandatory (Compose interpolates inactive services too, so passwords and tokens of unused profiles must not be).
  • Read-only root FS, cap_drop: ALL, no-new-privileges, tmpfs /tmp, log rotation.
  • Switching a part off: take it out of the profiles and docker compose rm -sf <service> (a plain up keeps running containers of inactive profiles) — noted in the file and README.

api health: probes the local /healthz, listed in the usage.

Tested locally with an API image built from this branch and the published agent images: db + redis profile → migrations (45) → API healthy, /readyz 200; api region add / api agent create via docker compose exec; then all four profiles → checker healthy and connected, status page healthy, /readyz 200; switching checker/statuspage off; down -v left nothing behind. Missing UPTIME_SECRET_KEYS fails with its message.

README gains a Docker Compose section.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

**`deploy/compose/compose.yaml`** + **`.env.example`** - `migrate` (one-shot `api migrate up`) → `api` starts only after it completed; API healthcheck via the new `api health` command (distroless image, no shell). - Profiles in `COMPOSE_PROFILES`: `db` (TimescaleDB, volume, pg_isready), `redis` (password, AOF on a volume), `checker`, `statuspage` (port, cache volume). Without `db`/`redis`, `UPTIME_DATABASE_URL` / `UPTIME_REDIS_URL` point to your own; `depends_on … required: false` keeps that working. - Only `UPTIME_PUBLIC_URL` and `UPTIME_SECRET_KEYS` are mandatory (Compose interpolates inactive services too, so passwords and tokens of unused profiles must not be). - Read-only root FS, `cap_drop: ALL`, `no-new-privileges`, tmpfs `/tmp`, log rotation. - Switching a part off: take it out of the profiles and `docker compose rm -sf <service>` (a plain `up` keeps running containers of inactive profiles) — noted in the file and README. **`api health`**: probes the local `/healthz`, listed in the usage. **Tested locally** with an API image built from this branch and the published agent images: db + redis profile → migrations (45) → API healthy, `/readyz` 200; `api region add` / `api agent create` via `docker compose exec`; then all four profiles → checker healthy and connected, status page healthy, `/readyz` 200; switching checker/statuspage off; `down -v` left nothing behind. Missing `UPTIME_SECRET_KEYS` fails with its message. README gains a Docker Compose section. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-23 20:50:46 +00:00
feat(deploy): Docker Compose setup for one host
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 12m24s
ci / test (pull_request) Successful in 12m37s
ci / build (pull_request) Successful in 15m44s
ci / image (pull_request) Successful in 4m34s
fc8c01b9a4
deploy/compose runs the console and API with a migration step before it
starts, and through COMPOSE_PROFILES optionally a bundled TimescaleDB and
Redis (leave them out to use your own by URL), a checker and a status
page server. Only the public URL and the secret keys are mandatory, so
every combination of profiles starts; containers run read-only without
capabilities. The API gains a health command for the image's
HEALTHCHECK, as checker and status page server have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 61fdfa830a into main 2026-11-23 20:54:14 +00:00
Sebi deleted branch feat/compose 2026-11-23 20:54:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#140