services:
  postgres:
    image: supabase/postgres:17.5.1.070-orioledb
    volumes:
      - postgres:/var/lib/postgresql/data
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    networks:
      - app
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
  web:
    depends_on:
      postgres:
        condition: service_healthy
        restart: true
    environment:
      DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres/postgres
volumes:
  postgres:
networks:
  app:
    external: true
  wan:
    external: true
