# PostgreSQL + PostGIS for WM-IMS local development.
# Matches backend/.env.example DATABASE_URL (wmims_user / password / wmims).
#
# From this folder (wm-ims): docker compose up -d
# Then: cd backend && npx prisma migrate deploy && npx prisma generate && npm run prisma:seed

services:
  db:
    image: postgis/postgis:16-3.4
    container_name: wmims-postgres
    environment:
      POSTGRES_USER: wmims_user
      POSTGRES_PASSWORD: password
      POSTGRES_DB: wmims
    ports:
      - "5432:5432"
    volumes:
      - wmims_pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U wmims_user -d wmims"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  wmims_pgdata:
