Files
Elternbeirat/compose.yaml
T
TomandClaude Opus 5.5 4968b62f06 Put the site behind NPM via proxynet, add Strato DynDNS updater
- eb-blazor joins the external network proxynet and publishes no host port;
  NPM forwards to eb-blazor:8080 by name
- Stack network gets the fixed name eb-internal (Compose Manager derives the
  project name from the stack folder); the dev overlay resets it and turns
  proxynet into a local network
- eb-ddns keeps the A record of elternbeirat-igmh.info at Strato current
- docs/unraid-infrastructure.md records the actual Unraid state

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

93 lines
3.9 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.
# 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: unless-stopped
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: unless-stopped
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: unless-stopped
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