CD workflow: - Uncommented deploy step - Copy docker-compose.yml + Caddyfile to server via SCP - Login to ghcr.io with DEPLOY_GHCR_TOKEN (classic PAT, read:packages) - Download Germany BRouter segments on first deploy (~750MB) - Pull images, restart services, verify Infrastructure: - BRouter segments as bind mount (./segments) not Docker volume - Added ORIGIN, PLANNER_URL, SESSION_SECRET, NODE_ENV to Journal - Added NODE_ENV to Planner - Disabled Garage for now (no media storage yet) Required secrets: DEPLOY_HOST, DEPLOY_SSH_KEY, DEPLOY_GHCR_TOKEN Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
services:
|
|
caddy:
|
|
image: caddy:2
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "443:443/udp"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
depends_on:
|
|
- journal
|
|
- planner
|
|
|
|
journal:
|
|
image: ghcr.io/trails-cool/journal:latest
|
|
restart: unless-stopped
|
|
environment:
|
|
DOMAIN: ${DOMAIN:-trails.cool}
|
|
ORIGIN: https://${DOMAIN:-trails.cool}
|
|
PLANNER_URL: https://planner.${DOMAIN:-trails.cool}
|
|
DATABASE_URL: postgres://trails:${POSTGRES_PASSWORD:-trails}@postgres:5432/trails
|
|
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
|
|
SESSION_SECRET: ${SESSION_SECRET:-change-me-in-production}
|
|
NODE_ENV: production
|
|
PORT: 3000
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
planner:
|
|
image: ghcr.io/trails-cool/planner:latest
|
|
restart: unless-stopped
|
|
environment:
|
|
BROUTER_URL: http://brouter:17777
|
|
DATABASE_URL: postgres://trails:${POSTGRES_PASSWORD:-trails}@postgres:5432/trails
|
|
NODE_ENV: production
|
|
PORT: 3001
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
brouter:
|
|
condition: service_started
|
|
|
|
brouter:
|
|
image: ghcr.io/trails-cool/brouter:latest
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./segments:/data/segments
|
|
# Segments can be pulled from:
|
|
# - https://brouter.de/brouter/segments4/ (official, weekly updates)
|
|
# - A trails.cool CDN mirror (later)
|
|
|
|
postgres:
|
|
image: postgis/postgis:16-3.4
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: trails
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-trails}
|
|
POSTGRES_DB: trails
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U trails"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# garage:
|
|
# image: dxflrs/garage:v1.0
|
|
# restart: unless-stopped
|
|
# volumes:
|
|
# - garage_data:/var/lib/garage
|
|
# - ./garage.toml:/etc/garage.toml:ro
|
|
|
|
volumes:
|
|
caddy_data:
|
|
caddy_config:
|
|
pgdata:
|