services:
  postgres:
    image: postgis/postgis:16-3.4
    environment:
      POSTGRES_USER: mpgis
      POSTGRES_PASSWORD: mpgis_dev
      POSTGRES_DB: mpgis_farmer
    ports:
      - "${POSTGRES_HOST_PORT:-5432}:5432"
    volumes:
      - mpgis_pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U mpgis"]
      interval: 5s
      timeout: 3s
      retries: 5

volumes:
  mpgis_pgdata:
