Files
Elternbeirat/compose.yaml
T
TomandClaude Opus 5.5 05b1666f81 Deploy the stack from the repo's compose.yaml via Gitea Actions
- deploy.yml gets a deploy job after the build: pull, compose up on Unraid
  through the runner's Docker socket, then a health gate on eb-blazor /health
  from inside proxynet; docs-only pushes trigger nothing, manual runs allowed
- STRATO_DYNDNS_PASSWORD comes from a Gitea secret instead of the Compose
  Manager env file
- restart: always, because Unraid stops containers explicitly on shutdown and
  unless-stopped would leave the stack down after a reboot; the dev overlay
  turns it off
- Docs describe the automatic rollout and the one-time switch away from the
  Compose Manager stack

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 00:37:42 +02:00

101 lines
4.3 KiB
YAML

# Base compose: production-like. PocketBase, the web app and the DynDNS updater;
# only PocketBase's data is a volume, everything else lives inside the images or
# in this file.
#
# NPM runs outside this stack (the `nginx` container on Unraid) and reaches the web
# app by name over the external Docker network `proxynet` (eb-blazor:8080), so the
# web app publishes no host port. The `ports:` block on PocketBase is TEMPORARY: it
# is the editors' way onto the admin UI until they reach it through an NPM subdomain
# (#9). Unraid setup: docs/unraid-infrastructure.md.
#
# On Unraid this file is deployed as is by .gitea/workflows/deploy.yml (project
# eb-stack), not pasted into the Compose Manager.
#
# `restart: always`, not `unless-stopped`: Unraid stops every container explicitly
# when Docker or the array goes down, and `unless-stopped` treats that as a manual
# stop -- the stack would stay down after a reboot. Without the Compose Manager
# there is no autostart toggle to bring it back.
# For local development use the dev overlay on top, which adds host ports and builds
# the web image from source:
# docker compose -f compose.yaml -f compose.dev.yaml up --build
# (The Rider run config "DevEnvironment" does exactly this with one click.)
#
# Startup order: PocketBase comes up first; once it reports healthy the web app
# starts (depends_on -> service_healthy).
# Fixed project name, so the stack has a stable name in Docker regardless of the
# folder name. Set once here in the base; overlays don't set their own name: (the
# tests override it with -p eb-test-stack).
name: eb-stack
services:
eb-pocketbase:
image: ghcr.io/muchobien/pocketbase:0.40.4
container_name: eb-pocketbase
restart: always
environment:
TZ: Europe/Berlin
volumes:
# The only state that must survive a restart or redeploy.
- /mnt/user/appdata/pocketbase/pb_data:/pb_data
ports:
# TEMPORARY: exposes the admin UI on the LAN (http://<unraid>:8090/_/) while
# NPM is not in front yet. Replace once the editors reach PocketBase through an
# NPM subdomain (#9): NPM points at eb-pocketbase:8090 over a shared network, so
# this host mapping can go -- until then the admin has no other way in.
- "8090:8090"
healthcheck:
# The image ships this endpoint; the web app waits for it to pass.
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8090/api/health"]
interval: 5s
timeout: 3s
retries: 10
eb-web:
image: gitea.anticarnist.de/tom/elternbeirat:latest
container_name: eb-blazor
restart: always
depends_on:
eb-pocketbase:
condition: service_healthy
environment:
ASPNETCORE_URLS: http://+:8080
TZ: Europe/Berlin
# The web app reads content from PocketBase over the compose network.
PocketBase__BaseUrl: http://eb-pocketbase:8090
networks:
# default: reach eb-pocketbase. proxynet: be reached by NPM as eb-blazor:8080.
- default
- proxynet
eb-ddns:
# Keeps the A record of elternbeirat-igmh.info at Strato pointed at the current
# public IP of the connection. The FritzBox can't do it: its single DynDNS slot
# already serves anticarnist.de. www is a CNAME on the domain and follows on its
# own. The whole config lives here in CONFIG, so the container needs no config
# file and no volume -- only the password comes from the stack's env
# (STRATO_DYNDNS_PASSWORD, never in the repo). The ":-" default keeps dev and
# tests quiet, where the service is disabled. Setup: docs/deployment.md.
image: qmcgaw/ddns-updater:2.10
container_name: eb-ddns
restart: always
environment:
TZ: Europe/Berlin
PERIOD: 5m
CONFIG: >-
{"settings":[
{"provider":"strato","domain":"elternbeirat-igmh.info","password":"${STRATO_DYNDNS_PASSWORD:-}","ip_version":"ipv4"}
]}
networks:
default:
# A fixed name instead of the project-derived one: the Compose Manager names the
# project after the stack folder (elternbeirat_default otherwise). Changing it
# needs Compose Down + Up; a plain Up leaves containers on the old network.
name: eb-internal
proxynet:
# Created once on Unraid (`docker network create proxynet`) and shared with NPM.
# The dev overlay turns it into a local network, so no machine but Unraid needs it.
external: true