2026-11-08 13:32:28 +01:00
|
|
|
# Tomter Vel's own platform: portal + its own Rauthy and NATS as podman
|
2026-09-28 12:15:30 +02:00
|
|
|
# containers. The content (pages, forms, desks) is not here: portal fetches
|
|
|
|
|
# it from tomtervel/questions on prosjekt.klingenbergbygg.no and hot-reloads
|
|
|
|
|
# it over NATS. This repo owns identity, the bus, and which portal version
|
|
|
|
|
# runs. TLS depends on where it runs: on a standalone host the bundled Caddy
|
|
|
|
|
# (`--profile edge`) terminates it; on kasse the host Caddy already owns
|
|
|
|
|
# 80/443 and reverse-proxies vel.klingenbergbygg.no -> portal (127.0.0.1:3050).
|
2026-09-22 19:06:31 +02:00
|
|
|
#
|
2026-11-08 13:32:28 +01:00
|
|
|
# Everything it runs with is an Actions variable or secret, written by
|
|
|
|
|
# the deploy workflow (README.md); `podman compose up -d --build` is
|
|
|
|
|
# what deploy-tomtervel runs.
|
2026-09-22 19:06:31 +02:00
|
|
|
|
|
|
|
|
name: tomtervel
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
caddy:
|
2026-09-28 12:15:30 +02:00
|
|
|
# Bundled TLS for a standalone host only: `podman compose --profile edge up`.
|
|
|
|
|
# On kasse the host Caddy already owns 80/443 (it reverse-proxies
|
|
|
|
|
# vel.klingenbergbygg.no -> 127.0.0.1:3050, the portal port below), so this
|
|
|
|
|
# is profiled off there to avoid the port clash. Default `up` skips it.
|
|
|
|
|
profiles: ["edge"]
|
2026-09-22 19:06:31 +02:00
|
|
|
image: caddy:2
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "80:80"
|
|
|
|
|
- "443:443"
|
|
|
|
|
- "443:443/udp"
|
|
|
|
|
environment:
|
|
|
|
|
PORTAL_HOST: ${PORTAL_HOST}
|
2026-11-08 13:32:28 +01:00
|
|
|
RAUTHY_HOST: ${RAUTHY_HOST}
|
2026-09-22 19:06:31 +02:00
|
|
|
volumes:
|
|
|
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
|
|
|
- caddy_data:/data
|
|
|
|
|
- caddy_config:/config
|
|
|
|
|
depends_on:
|
|
|
|
|
- portal
|
2026-11-08 13:32:28 +01:00
|
|
|
- rauthy
|
2026-09-22 19:06:31 +02:00
|
|
|
|
|
|
|
|
nats:
|
|
|
|
|
image: nats:2.14.6-alpine
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
command: ["-c", "/etc/nats/nats.conf"]
|
2026-11-07 16:44:51 +01:00
|
|
|
# NATS_PASSWORD, which nats.conf reads from the environment.
|
|
|
|
|
env_file: nats.env
|
2026-09-22 19:06:31 +02:00
|
|
|
volumes:
|
|
|
|
|
- ./nats/nats.conf:/etc/nats/nats.conf:ro
|
|
|
|
|
- nats_data:/data
|
2026-09-28 12:31:14 +02:00
|
|
|
# Published on the host so the reload job (`nats pub portal.content.reload ""`)
|
|
|
|
|
# can reach it; password-protected (see nats.conf). Host port 4223, not 4222:
|
|
|
|
|
# on kasse the shared platform NATS already owns 127.0.0.1:4222 and the vel
|
|
|
|
|
# runs its own NATS in isolation, so the reload workflow targets 4223 there.
|
|
|
|
|
# (Standalone, nothing else owns 4222, but 4223 is harmless.)
|
2026-09-22 19:06:31 +02:00
|
|
|
ports:
|
2026-09-28 12:31:14 +02:00
|
|
|
- "127.0.0.1:4223:4222"
|
2026-09-22 19:06:31 +02:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
|
2026-11-08 13:32:28 +01:00
|
|
|
# Rauthy: who is who. Sign-in, account pages and account mail, in
|
|
|
|
|
# Norwegian; portal and the chat sign in here (OIDC_ISSUER) and portal
|
|
|
|
|
# makes accounts here (RAUTHY_API_KEY). Its database is embedded
|
|
|
|
|
# (hiqlite), in rauthy_data. Host-published for kasse's host Caddy
|
|
|
|
|
# (RAUTHY_HOST -> here).
|
2026-11-07 22:33:46 +01:00
|
|
|
rauthy:
|
|
|
|
|
image: ghcr.io/sebadob/rauthy:${RAUTHY_TAG:-0.37.2}
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
env_file:
|
|
|
|
|
- path: rauthy.env
|
|
|
|
|
required: false
|
|
|
|
|
environment:
|
|
|
|
|
PUB_URL: ${RAUTHY_HOST:-no-host-set}
|
|
|
|
|
RP_ID: ${RAUTHY_HOST:-no-host-set}
|
|
|
|
|
# Rauthy wants the port spelled out.
|
|
|
|
|
RP_ORIGIN: https://${RAUTHY_HOST:-no-host-set}:443
|
|
|
|
|
extra_hosts:
|
|
|
|
|
- "host.containers.internal:host-gateway"
|
|
|
|
|
volumes:
|
|
|
|
|
- ./rauthy/config.toml:/app/config.toml:ro
|
|
|
|
|
- rauthy_data:/app/data
|
|
|
|
|
ports:
|
|
|
|
|
- "127.0.0.1:8090:8080"
|
|
|
|
|
|
2026-09-22 19:06:31 +02:00
|
|
|
portal:
|
|
|
|
|
build:
|
|
|
|
|
context: ./portal
|
|
|
|
|
args:
|
|
|
|
|
PORTAL_RELEASE: ${PORTAL_RELEASE}
|
2026-11-08 15:52:45 +01:00
|
|
|
# Named, so the content repo's preview (tomtervel/questions,
|
|
|
|
|
# lint-and-reload.yml) runs the very image this site runs.
|
|
|
|
|
image: localhost/tomtervel-portal:${PORTAL_RELEASE}
|
2026-09-22 19:06:31 +02:00
|
|
|
restart: unless-stopped
|
2026-11-07 16:44:51 +01:00
|
|
|
# Written by the deploy workflow from the Actions variables and
|
|
|
|
|
# secrets (README.md has the table).
|
2026-09-22 19:06:31 +02:00
|
|
|
env_file: portal.env
|
|
|
|
|
environment:
|
|
|
|
|
LEPTOS_SITE_ADDR: 0.0.0.0:3000
|
|
|
|
|
LEPTOS_SITE_ROOT: site
|
|
|
|
|
LEPTOS_HASH_FILES: "true"
|
2026-11-01 13:15:04 +01:00
|
|
|
LEARN_CACHE: /app/learn-cache
|
|
|
|
|
OLLAMA_HOST: http://100.64.0.1:11434
|
|
|
|
|
# The namespace of everything this site keeps on NATS from portal 0.9.
|
|
|
|
|
# Must not change: a new name is a new, empty site.
|
|
|
|
|
SITE_NAME: tomtervel
|
|
|
|
|
volumes:
|
|
|
|
|
- learn_cache:/app/learn-cache
|
2026-09-28 12:15:30 +02:00
|
|
|
ports:
|
|
|
|
|
# Host-published for kasse's host Caddy (vel.klingenbergbygg.no -> here).
|
|
|
|
|
# With --profile edge the bundled Caddy proxies portal:3000 internally
|
|
|
|
|
# instead, but publishing loopback-only is harmless there.
|
|
|
|
|
- "127.0.0.1:3050:3000"
|
2026-09-22 19:06:31 +02:00
|
|
|
depends_on:
|
|
|
|
|
nats:
|
|
|
|
|
condition: service_healthy
|
2026-11-08 13:32:28 +01:00
|
|
|
rauthy:
|
2026-09-22 19:06:31 +02:00
|
|
|
condition: service_started
|
|
|
|
|
|
2026-09-28 20:37:07 +02:00
|
|
|
# The mailer. Portal decides what to send - a `mail:` on a state in the
|
|
|
|
|
# content, or an invite - and publishes it on this NATS; gdo is what
|
|
|
|
|
# actually hands it to a mail server. It is in the vel's own stack rather
|
|
|
|
|
# than shared, so the vel's mail leaves on the vel's own terms, but it
|
|
|
|
|
# has no mail server of its own: it relays through the host's, which on
|
|
|
|
|
# kasse is Klingenberg Bygg's postfix on port 25. That is the one thing
|
|
|
|
|
# here the vel borrows.
|
|
|
|
|
gdo:
|
|
|
|
|
build:
|
|
|
|
|
context: ./gdo
|
|
|
|
|
args:
|
|
|
|
|
GDO_RELEASE: ${GDO_RELEASE}
|
|
|
|
|
restart: unless-stopped
|
2026-11-07 16:29:55 +01:00
|
|
|
# NATS_URL, with the password: made by bootstrap.sh, never committed.
|
|
|
|
|
env_file: nats.env
|
2026-09-28 20:37:07 +02:00
|
|
|
environment:
|
|
|
|
|
# The host, from inside the container. Podman resolves this to the
|
|
|
|
|
# gateway; the host's postfix listens on 0.0.0.0:25.
|
|
|
|
|
SMTP_HOST: host.containers.internal
|
|
|
|
|
SMTP_PORT: "25"
|
|
|
|
|
# A strict server refuses a bare container hostname in EHLO.
|
|
|
|
|
SMTP_HELO: ${PORTAL_HOST}
|
|
|
|
|
extra_hosts:
|
|
|
|
|
- "host.containers.internal:host-gateway"
|
|
|
|
|
depends_on:
|
|
|
|
|
nats:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
2026-09-28 11:15:29 +02:00
|
|
|
# The Gitea Actions runner is a host service on kasse (pacman gitea-runner),
|
|
|
|
|
# registered against prosjekt.klingenbergbygg.no. It reaches this NATS via the
|
|
|
|
|
# published 127.0.0.1:4222 port above, so no in-compose runner — and no
|
|
|
|
|
# docker.sock/podman.sock mount — is needed here.
|
2026-09-22 19:06:31 +02:00
|
|
|
|
2026-11-03 07:57:35 +01:00
|
|
|
# The vel's conversations: every group the content names is a room,
|
|
|
|
|
# portal speaks in them and decides who gets in. Its history is on the
|
|
|
|
|
# vel's own NATS (stream tomtervel_CHAT); there is no Postgres. A
|
|
|
|
|
# profile, since it needs chat.env: go-live sets COMPOSE_PROFILES=chat
|
|
|
|
|
# in .env once it is there. Host-published for kasse's host Caddy
|
|
|
|
|
# (chat.vel.klingenbergbygg.no -> here).
|
|
|
|
|
cnats:
|
|
|
|
|
profiles: ["chat"]
|
|
|
|
|
image: docker.io/bendik/cnats:${CNATS_TAG:-no-tag-set}
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
env_file:
|
2026-11-07 16:29:55 +01:00
|
|
|
- nats.env
|
2026-11-03 07:57:35 +01:00
|
|
|
- path: chat.env
|
|
|
|
|
required: false
|
|
|
|
|
environment:
|
|
|
|
|
# Must be the portal's own: a new name is a new, empty chat.
|
|
|
|
|
SITE_NAME: tomtervel
|
2026-11-08 13:32:28 +01:00
|
|
|
# Rauthy: https://<RAUTHY_HOST>/auth/v1/
|
|
|
|
|
OIDC_ISSUER: ${OIDC_ISSUER}
|
2026-11-07 16:29:55 +01:00
|
|
|
PUBLIC_URL: https://${CHAT_HOST}
|
2026-11-03 07:57:35 +01:00
|
|
|
COOKIE_SECURE: "true"
|
|
|
|
|
ports:
|
|
|
|
|
- "127.0.0.1:3070:3000"
|
|
|
|
|
depends_on:
|
|
|
|
|
nats:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
2026-11-03 01:29:44 +01:00
|
|
|
# Where uploads go: the pictures and documents a desk attaches, and what
|
|
|
|
|
# `portal import` brings in. One node on this host, reachable only inside
|
|
|
|
|
# the project; nothing is published. go-live.sh garage renders
|
|
|
|
|
# garage/garage.toml (gitignored: it holds the node's rpc secret), makes
|
|
|
|
|
# the bucket and the key, and puts the four GARAGE_* in portal.env.
|
|
|
|
|
garage:
|
|
|
|
|
image: docker.io/dxflrs/garage:v2.3.0
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
volumes:
|
|
|
|
|
- ./garage/garage.toml:/etc/garage.toml:ro
|
|
|
|
|
- garage_data:/var/lib/garage
|
|
|
|
|
|
2026-09-22 19:06:31 +02:00
|
|
|
volumes:
|
2026-11-03 01:29:44 +01:00
|
|
|
garage_data:
|
2026-09-22 19:06:31 +02:00
|
|
|
caddy_data:
|
|
|
|
|
caddy_config:
|
|
|
|
|
nats_data:
|
2026-11-07 22:33:46 +01:00
|
|
|
rauthy_data:
|
2026-11-01 13:15:04 +01:00
|
|
|
learn_cache:
|
2026-09-28 11:15:29 +02:00
|
|
|
|
2026-11-08 13:32:28 +01:00
|
|
|
# Pin the project network subnet inside 172.16/12 so Rauthy's trusted
|
|
|
|
|
# proxies (rauthy/config.toml) stay valid under Podman — its default pool
|
|
|
|
|
# hands out 10.89.x addresses that the forwarded client IP can't match.
|
2026-09-28 11:15:29 +02:00
|
|
|
networks:
|
|
|
|
|
default:
|
|
|
|
|
ipam:
|
|
|
|
|
config:
|
|
|
|
|
- subnet: 172.18.0.0/16
|