services:
  postgres:
    image: postgres:15
    container_name: marquez-db
    ports:
      - "5433:5432"
    environment:
      POSTGRES_USER: marquez
      POSTGRES_PASSWORD: marquez
      POSTGRES_DB: marquez
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "marquez"]
      interval: 5s
      timeout: 5s
      retries: 5

  marquez:
    image: marquezproject/marquez:latest
    container_name: marquez
    ports:
      - "5000:5000"
      - "5001:5001"
    environment:
      POSTGRES_HOST: postgres
      POSTGRES_PORT: 5432
      POSTGRES_DB: marquez
      POSTGRES_USER: marquez
      POSTGRES_PASSWORD: marquez
      MARQUEZ_PORT: 5000
      MARQUEZ_ADMIN_PORT: 5001
    depends_on:
      postgres:
        condition: service_healthy

  marquez-web:
    image: marquezproject/marquez-web:latest
    container_name: marquez-web
    ports:
      - "3001:3000"
    environment:
      MARQUEZ_HOST: marquez
      MARQUEZ_PORT: 5000
      WEB_PORT: 3000
    depends_on:
      - marquez

volumes:
  postgres-data:
