services:
  postgres:
    image: postgis/postgis:17-3.5
    environment:
      POSTGRES_DB: clickdelivery
      POSTGRES_USER: clickdelivery_admin
      POSTGRES_PASSWORD: clickdelivery_admin_dev
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U clickdelivery_admin -d clickdelivery"]
      interval: 5s
      timeout: 3s
      retries: 20
    volumes:
      - clickdelivery_pg:/var/lib/postgresql/data
      - ./database/postgres/init:/docker-entrypoint-initdb.d:ro

volumes:
  clickdelivery_pg:
