services:
  asn-header:
    image: gitea.mindboost.team/mindboost/education-flagger-header:${IMAGE_TAG}
    container_name: staging-asn-header
    restart: unless-stopped
    env_file: .env
    environment:
      MMDB_PATH: /data/GeoLite2-ASN.mmdb
      ASN_LIST_PATH: /data/nren_asns.txt
      ADDR: ":8080"
    volumes:
      - asn_data:/data:ro
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:8080/healthz"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s
    networks:
      - proxy

  asn-updater:
    image: gitea.mindboost.team/mindboost/education-flagger-updater:${IMAGE_TAG}
    container_name: staging-asn-updater
    restart: unless-stopped
    env_file: .env
    healthcheck:
      disable: true
    environment:
      OUT_DIR: /data
      PDB_INFO_TYPE: "${PDB_INFO_TYPE}"
      INTERVAL_SECONDS: "${UPDATE_INTERVAL_SECONDS}"
    volumes:
      - asn_data:/data
    networks:
      - proxy

networks:
  proxy:
    external: true
    name: ${PROXY_NETWORK}

volumes:
  asn_data:
    name: staging_asn_data
