Add TrailBase Docker packaging (root and rootless)

Multi-stage Alpine images that download a pinned TrailBase release,
verify its SHA-256 digests, and ship only the static binary plus the
auth UI component. The entrypoint bootstraps the admin from .env by
taking over the auto-created admin@localhost on a fresh depot.

Includes compose files, .env.example, bump.sh and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-19 00:09:11 +01:00
commit c370bfdc5b
11 files changed
+776

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
# Copy this file to `.env` and adjust as needed:
# cp .env.example .env
# Compose reads `.env` automatically. Keep `.env` OUT of version control.
# ── General ───────────────────────────────────────────────────────────
# TrailBase version to build (must match a published release tag, without the leading "v").
# Change it with ./bump.sh so the pinned checksums in the Dockerfiles stay in sync.
TB_VERSION=0.36.1
# Name of the running container
CONTAINER_NAME=trailbase
# Port TrailBase listens on (used both inside the container and for the host mapping)
TB_PORT=4000
# Port for the root variant (only used with docker-compose.root.yml)
TB_PORT_ROOT=4000
# Public URL TrailBase is reached at (e.g. https://api.example.com).
# Needed for valid links in auth emails and for OAuth redirects. Leave blank for local use.
TB_PUBLIC_URL=
# ── Admin bootstrap ───────────────────────────────────────────────────
# On every start the entrypoint checks whether TB_ADMIN_EMAIL already exists:
# • admin exists → nothing happens (TB_ADMIN_PASSWORD is ignored/optional)
# • user, not admin → the user is promoted to admin
# • missing → the admin is created with TB_ADMIN_PASSWORD (required in that case)
# On a fresh depot the admin is made by taking over TrailBase's auto-created
# `admin@localhost` account, so no stray default admin is left behind.
# No defaults. Leave blank to skip bootstrapping entirely — TrailBase then creates
# `admin@localhost` on first start and prints its random password in the container log.
TB_ADMIN_EMAIL=
TB_ADMIN_PASSWORD=