name: milan-sql-index-lab

services:
  postgres:
    image: postgres:18.6-alpine
    environment:
      POSTGRES_USER: lab
      POSTGRES_PASSWORD: local-lab-only
      POSTGRES_DB: indexing
    # No host port: use `docker compose exec` for this local exercise.
    volumes:
      - data:/var/lib/postgresql
      - .:/lab:ro
    healthcheck:
      test: [CMD-SHELL, pg_isready -U lab -d indexing]
      interval: 2s
      timeout: 5s
      retries: 30

volumes:
  data:
