# Run industrial sync in Docker.
# From repo root: docker compose -f scripts/docker-compose.yml build
#                docker compose -f scripts/docker-compose.yml run --rm sync --district=Manukau
# From scripts/: docker compose build && docker compose run --rm sync --district=Manukau

services:
  sync:
    build:
      context: .
      dockerfile: scripts/Dockerfile
    image: industrial-sync:latest
    env_file:
      - .env
    environment:
      - INDUSTRIAL_API_BASE_URL=${INDUSTRIAL_API_BASE_URL:-http://host.docker.internal:8090}
      - DB_CONFIG_PATH=/app/db_config.json
    volumes:
      # Mount DB config from host (copy scripts/db_config.example.json to scripts/db_config.json and edit)
      - ./scripts/db_config.json:/app/db_config.json:ro
    # Default: all districts. Override for single: command: ["--district=Manukau", "--base-url=..."]
    command: ["--all-districts", "--base-url=http://host.docker.internal:8090"]
