Files

67 lines
2.9 KiB
YAML

# Base compose: production-like. Both services; only PocketBase's data is a volume,
# everything else lives inside the images.
#
# The two `ports:` blocks below are TEMPORARY. The target state is NPM in front:
# NPM terminates TLS and is the only path to the web app, and the editors reach
# PocketBase through an NPM subdomain (#9). NPM still needs a target address and
# port, so a port stays reachable either way -- the plan is to reach the containers
# by name over a shared Docker network (e.g. eb-blazor:8080) instead of publishing
# them on the LAN, and to drop these host mappings that expose the site and admin UI
# to anyone on the LAN. While NPM is not set up yet, these mappings are the only way
# onto the site and the admin UI.
#
# 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
ports:
# TEMPORARY: reach the site on the LAN (http://<unraid>:5000) while NPM is not
# in front yet. Replace once NPM terminates TLS and fronts the site (#9): join
# the external NPM network and let NPM point at eb-blazor:8080 by name, so this
# host mapping can go and the site is no longer open on the LAN.
- "5000:8080"