services:
  gtd-api:
    build: .
    container_name: gtd-api
    restart: unless-stopped
    env_file: .env
    networks:
      # Reach Postgres by service name `personal-db` on its network.
      - personal-db_default
      # Be reachable by paico-proxy for gtd.rehbock.xyz.
      - caddy_net
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000/healthz || exit 1"]
      interval: 30s
      timeout: 5s
      retries: 3

networks:
  personal-db_default:
    external: true
  caddy_net:
    external: true
