Files
ttrpg-initiative-tracker/docker-compose.yml
T

60 lines
1.6 KiB
YAML
Raw Normal View History

# docker-compose.yml — two profiles:
# firebase: existing Dockerfile (nginx + firebase build), upstream path
# backend: full stack (caddy frontend + node backend + sqlite volume)
#
# Usage:
# docker compose --profile backend up --build # full self-hosted stack
# docker compose --profile firebase up --build # firebase-only (upstream)
#
# Run local in OrbStack; remote docker context later (just change context).
services:
# ---- full self-hosted stack (STORAGE=ws) ----
backend:
profiles: ["backend"]
build:
context: .
dockerfile: server/Dockerfile
image: ttrpg-backend:local
volumes:
- backend-data:/data
environment:
- DB_PATH=/data/tracker.sqlite
- PORT=4001
# - CORS_ORIGIN=* # Caddy same-origin, cors not strictly needed
expose:
- "4001"
restart: unless-stopped
frontend:
profiles: ["backend"]
build:
context: .
dockerfile: Dockerfile.ws
args:
- REACT_APP_TRACKER_APP_ID=${TRACKER_APP_ID:-ttrpg-initiative-tracker-default}
image: ttrpg-frontend:local
ports:
- "${FRONTEND_PORT:-8080}:80"
depends_on:
- backend
# Optional basic auth: set in .env as CADDY_BASIC_AUTH="user <hashed-pass>"
# Generate hash: caddy hash-password
environment:
- CADDY_BASIC_AUTH=${CADDY_BASIC_AUTH:-}
restart: unless-stopped
# ---- firebase-only path (upstream, existing Dockerfile) ----
firebase:
profiles: ["firebase"]
build:
context: .
dockerfile: Dockerfile
image: ttrpg-firebase:local
ports:
- "${FRONTEND_PORT:-8080}:80"
restart: unless-stopped
volumes:
backend-data: