version: "3.8"

services:
  # Frontend map server
  mapserver:
    image: nginx:alpine
    container_name: pupmap-server
    volumes:
      - /mnt/storage/docker-data/pupmap/www:/usr/share/nginx/html:ro
      # Make sure data folder is inside www/, e.g., www/data/
    ports:
      - "8084:80"   # Map frontend available on 8084
    restart: unless-stopped

  # Nominatim search API
  nominatim:
    image: mediagis/nominatim:4.4
    container_name: pupmap-nominatim
    environment:
      - PBF_PATH=/nominatim-pbf/europe-latest.osm.pbf
      - NOMINATIM_IMPORT=1
      - POSTGRES_SHARED_BUFFERS=2GB
      - POSTGRES_AUTOVACUUM=on
    ports:
      - "7070:8080"   # Nominatim API
    volumes:
      - /mnt/storage/docker-data/pupmap/nominatim-pbf:/nominatim-pbf:ro  # PBF folder (read-only)
      - /mnt/storage/docker-data/pupmap/nominatim-db:/var/lib/postgresql/14/main  # DB folder (empty, host-owned)
    restart: unless-stopped

