services:
  geoserver:
    image: kartoza/geoserver:2.24.1
    depends_on:
      - db
    environment:
      - GEOSERVER_ADMIN_USER=${GEOSERVER_ADMIN_USER}
      - GEOSERVER_ADMIN_PASSWORD=${GEOSERVER_ADMIN_PASSWORD}
      - INITIAL_MEMORY=${INITIAL_MEMORY}
      - MAXIMUM_MEMORY=${MAXIMUM_MEMORY}
    volumes:
      - geoserver-data:/opt/geoserver/data_dir
    restart: unless-stopped

  db:
    image: postgis/postgis:17-3.4
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=${POSTGRES_DB}
    volumes:
      - postgis-data:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  geoserver-data:
  postgis-data:
