mirror of
https://github.com/db9979/wibosim.git
synced 2026-12-05 12:24:46 +01:00
- auto-update.sh holt Images weiter alle 5 Minuten, spielt aber erst ein, wenn das Spiel es erlaubt (POST /api/ops/update-ok per docker exec): Update-Fenster (Standard 03:00–05:00), Börse zu ohne Battle, sofort, dringende Version (urgent: true im Changelog), Admin-Knopf „Jetzt einspielen“; Rückfall: einspielen - Hinweis an Spieler einige Minuten vorher (updSoon), Sicherung per VACUUM INTO unmittelbar vor dem Neustart mit eigener Rotation, Gesundheitsprüfung über /healthz, automatisch zurück auf das vorige Image und notfalls Spielstand zurückspielen, Ausfall-Meldung an die Spielleitung - Admin: Gruppe „Update-Fenster“ und Karte „Update“ (wartende Version, Plan, Verlauf, Zurücksetzen mit Bestätigung); rollback.sh --vorher [--mit-daten] mit Rückfrage; gemeinsame Bausteine in scripts/lib-update.sh - „Was ist neu“: gebündelt seit der zuletzt gesehenen Version des Kontos, gruppiert, höchstens 8 Punkte sichtbar, ohne Admin-Zeilen, nicht für neue Spieler - Test-Instanz (docker compose --profile test): Kopie der neuesten Live-Sicherung, Mails/Push/Taby aus, TESTINSTANZ im Kopf - Tests: updgate, whatsnew/testinst, Skripte mit Attrappen; docs/BETRIEB.md mit Einrichtung, Umstellung, Was tun wenn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUhQVoPUusUzxgxLWkK
97 lines
3.7 KiB
YAML
97 lines
3.7 KiB
YAML
# Standard: fertiges Image aus der GitHub Container Registry (amd64 + arm64).
|
||
# Aktualisieren: automatisch im Update-Fenster (scripts/install-autoupdate.sh), von Hand: docker compose pull && docker compose up -d
|
||
# Bestimmte Version: WIBOSIM_TAG=sha-abc1234 docker compose up -d (siehe scripts/rollback.sh)
|
||
# Selbst bauen: docker compose up -d --build
|
||
# Optional HTTPS im Heimnetz über Caddy: docker compose --profile https up -d
|
||
services:
|
||
wibosim:
|
||
image: ghcr.io/db9979/wibosim:${WIBOSIM_TAG:-latest}
|
||
build: .
|
||
container_name: wibosim
|
||
restart: unless-stopped
|
||
ports:
|
||
- "8086:8086"
|
||
volumes:
|
||
- wibosim-data:/data
|
||
# Sicherung außer Haus (siehe docs/BETRIEB.md): NAS bzw. USB-Stick auf dem Pi einhängen, z. B. unter
|
||
# /mnt/wibosim-backup, und hier einbinden; im Admin-Menü als Zielordner /backup-nas eintragen.
|
||
# - /mnt/wibosim-backup:/backup-nas
|
||
env_file:
|
||
- path: .env
|
||
required: false
|
||
environment:
|
||
TZ: Europe/Berlin
|
||
BASE_URL: ${BASE_URL:-http://192.168.178.21:8086}
|
||
# JS-Heap passend zu mem_limit (Lasttest mit 50 Spielern: Heap ≈ 75 MB, RSS ≈ 250 MB, siehe docs/BETRIEB.md):
|
||
# der Garbage Collector räumt rechtzeitig auf, statt dass der Container an der Speichergrenze beendet wird
|
||
NODE_OPTIONS: ${WIBOSIM_NODE_OPTIONS:---max-old-space-size=192}
|
||
stop_grace_period: 20s
|
||
# Gesundheitsprüfung (Team Wache): /healthz antwortet 503, wenn der Spieltakt steht. „docker ps“ zeigt dann
|
||
# „unhealthy“; ein externer Wächter (Cron auf Pi/NAS, siehe docs/BETRIEB.md) kann melden bzw. neu starten.
|
||
healthcheck:
|
||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8086/healthz"]
|
||
interval: 30s
|
||
timeout: 5s
|
||
start_period: 60s
|
||
retries: 3
|
||
# Schonend für den Pi
|
||
mem_limit: 384m
|
||
logging:
|
||
driver: json-file
|
||
options: { max-size: "5m", max-file: "3" }
|
||
|
||
# Test-Instanz (Team Betrieb 2, docs/BETRIEB.md → „Test-Instanz auf dem Pi“), nur auf Wunsch:
|
||
# docker compose --profile test up -d wibosim-test → http://<pi>:8087, Kopf zeigt „TESTINSTANZ“
|
||
# docker compose --profile test stop wibosim-test
|
||
# Beim ersten Start kopiert sie die neueste Sicherung der Live-Instanz (nur lesend eingebunden) als Spielstand.
|
||
# Mails, Push, Taby, Sicherung außer Haus und Update-Hinweis sind aus. Image-Tag: WIBOSIM_TEST_TAG (Standard latest,
|
||
# also die neueste geholte Version – auch wenn die Live-Instanz noch auf ihr Update-Fenster wartet).
|
||
wibosim-test:
|
||
image: ghcr.io/db9979/wibosim:${WIBOSIM_TEST_TAG:-latest}
|
||
profiles: ["test"]
|
||
container_name: wibosim-test
|
||
restart: "no"
|
||
ports:
|
||
- "${WIBOSIM_TEST_PORT:-8087}:8086"
|
||
volumes:
|
||
- wibosim-test-data:/data
|
||
- wibosim-data:/live:ro
|
||
environment:
|
||
TZ: Europe/Berlin
|
||
WIBOSIM_TEST: "1"
|
||
UPDATE_CHECK: "off"
|
||
TIME_MODE: ${TIME_MODE:-hybrid}
|
||
BASE_URL: ${WIBOSIM_TEST_URL:-http://192.168.178.21:8087}
|
||
NODE_OPTIONS: --max-old-space-size=160
|
||
stop_grace_period: 20s
|
||
healthcheck:
|
||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8086/healthz"]
|
||
interval: 60s
|
||
timeout: 5s
|
||
start_period: 60s
|
||
retries: 3
|
||
mem_limit: 320m
|
||
logging:
|
||
driver: json-file
|
||
options: { max-size: "2m", max-file: "2" }
|
||
|
||
caddy:
|
||
image: caddy:2-alpine
|
||
profiles: ["https"]
|
||
container_name: wibosim-caddy
|
||
restart: unless-stopped
|
||
depends_on: [wibosim]
|
||
ports:
|
||
- "443:443"
|
||
- "80:80"
|
||
volumes:
|
||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||
- caddy-data:/data
|
||
environment:
|
||
WIBOSIM_HOST: ${WIBOSIM_HOST:-wibosim.local}
|
||
|
||
volumes:
|
||
wibosim-data:
|
||
wibosim-test-data:
|
||
caddy-data:
|