Passwörter mit / + = @ (z. B. aus openssl rand -base64) machten DATABASE_URL ungültig
("TypeError: Invalid URL", api und worker im Neustart-Loop). Lokal mit Passwort "Ab/cd+ef=gh9" geprüft.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93 lines
2.8 KiB
YAML
93 lines
2.8 KiB
YAML
# ATM10 Stats – eigenständiger Server mit Host-Netzwerk, Traefik läuft auf einem ANDEREN Server.
|
||
#
|
||
# Für Docker in einem (unprivilegierten) Proxmox-LXC-Container: Dort fehlt oft das NAT für Docker-Bridge-Netze,
|
||
# Container kommen dann nicht ins Netz (DNS, Proxy, SFTP). Mit network_mode: host nutzen alle Dienste direkt das
|
||
# Netz des LXC-Containers.
|
||
#
|
||
# cp deploy/.env.example deploy/.env # Werte eintragen (TRUST_PROXY = IP des Traefik-Servers!)
|
||
# sh deploy/build.sh # Images im Host-Netzwerk bauen (nach jedem git pull)
|
||
# docker compose -f deploy/docker-compose.standalone.yml --env-file deploy/.env up -d
|
||
#
|
||
# Erreichbar auf dem LXC-Container: web http://<LXC-IP>:3000 api http://<LXC-IP>:3001
|
||
# Die Datenbank lauscht nur auf 127.0.0.1. Traefik-Konfiguration: docs/OPERATIONS.md, "Traefik auf einem anderen Server".
|
||
|
||
name: atm10-stats
|
||
|
||
x-backend: &backend
|
||
# built by deploy/build.sh (docker build --network host)
|
||
image: atm10-stats/backend:latest
|
||
pull_policy: never
|
||
restart: unless-stopped
|
||
network_mode: host
|
||
env_file: ${ENV_FILE:-.env}
|
||
environment:
|
||
# Password via PGPASSWORD (read by the PostgreSQL driver): any character works; in the URL "/", "+" or "@" break it.
|
||
DATABASE_URL: postgres://atm@127.0.0.1:5432/atm
|
||
PGPASSWORD: ${POSTGRES_PASSWORD}
|
||
HTTP_PROXY: ${HTTP_PROXY:-}
|
||
HTTPS_PROXY: ${HTTPS_PROXY:-}
|
||
NO_PROXY: ${NO_PROXY:-},localhost,127.0.0.1
|
||
depends_on:
|
||
db:
|
||
condition: service_healthy
|
||
|
||
services:
|
||
db:
|
||
image: postgres:16-alpine
|
||
restart: unless-stopped
|
||
network_mode: host
|
||
command: ["postgres", "-c", "listen_addresses=127.0.0.1", "-c", "port=5432"]
|
||
environment:
|
||
POSTGRES_DB: atm
|
||
POSTGRES_USER: atm
|
||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD fehlt}
|
||
volumes:
|
||
- db-data:/var/lib/postgresql/data
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U atm -d atm"]
|
||
interval: 10s
|
||
timeout: 5s
|
||
retries: 10
|
||
|
||
api:
|
||
<<: *backend
|
||
command: ["node", "dist/server.js"]
|
||
|
||
worker:
|
||
<<: *backend
|
||
command: ["node", "dist/worker.js"]
|
||
healthcheck:
|
||
disable: true
|
||
|
||
web:
|
||
# built by deploy/build.sh (docker build --network host)
|
||
image: atm10-stats/web:latest
|
||
pull_policy: never
|
||
restart: unless-stopped
|
||
network_mode: host
|
||
environment:
|
||
API_INTERNAL_URL: http://127.0.0.1:3001
|
||
depends_on: [api]
|
||
|
||
backup:
|
||
image: postgres:16-alpine
|
||
restart: unless-stopped
|
||
network_mode: host
|
||
environment:
|
||
PGHOST: 127.0.0.1
|
||
PGUSER: atm
|
||
PGDATABASE: atm
|
||
PGPASSWORD: ${POSTGRES_PASSWORD}
|
||
BACKUP_KEEP_DAYS: ${BACKUP_KEEP_DAYS:-14}
|
||
volumes:
|
||
- ./backup.sh:/backup.sh:ro
|
||
- backups:/backups
|
||
entrypoint: ["/bin/sh", "/backup.sh", "loop"]
|
||
depends_on:
|
||
db:
|
||
condition: service_healthy
|
||
|
||
volumes:
|
||
db-data:
|
||
backups:
|