# ---------------------------------------------------------------------------
# GPS-Denied Onboard — Local Development Compose
# ---------------------------------------------------------------------------
# Usage:
#   docker compose up --build        # start service
#   docker compose down -v           # stop + remove volumes

version: "3.9"

services:
  gps-denied:
    build:
      context: .
      dockerfile: Dockerfile
    image: gps-denied-onboard:dev
    container_name: gps-denied-dev
    ports:
      - "8000:8000"
    environment:
      GPS_DENIED_DB_PATH: /data/flights.db
      GPS_DENIED_TILE_DIR: /data/satellite_tiles
      GPS_DENIED_LOG_LEVEL: DEBUG
    volumes:
      # Persistent data: SQLite DB + satellite tile cache
      - gps_denied_data:/data
      # Hot-reload: mount source for dev iteration
      - ./src:/app/src:ro
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "python", "-c",
             "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s

volumes:
  gps_denied_data:
    driver: local
