services:
  postgres:
    image: imresamu/postgis:16-3.4  # multi-arch (amd64 + arm64)
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: trails
      POSTGRES_PASSWORD: trails
      POSTGRES_DB: trails
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U trails"]
      interval: 5s
      timeout: 5s
      retries: 5

  brouter:
    build: docker/brouter
    ports:
      - "17777:17777"
    volumes:
      - brouter_segments:/data/segments

volumes:
  pgdata:
  brouter_segments:
