# docker/docker-compose.yml — single container: caddy (front) + node (back).
# Usage (from repo root):
#   docker compose -f docker/docker-compose.yml up --build
services:
  app:
    # no image: field => compose auto-names (docker-app), never pulls,
    # always builds local. Service image private, never published.
    build:
      context: ..
      dockerfile: docker/Dockerfile
      args:
        - REACT_APP_TRACKER_APP_ID=${TRACKER_APP_ID:-ttrpg-initiative-tracker-default}
    ports:
      - "${PORT:-8080}:80"
    volumes:
      - app-data:/data
    environment:
      - DB_PATH=/data/tracker.sqlite
      - PORT=4001
    restart: unless-stopped

volumes:
  app-data:
