version: "3.9"

services:
  dgraph-zero:
    image: dgraph/dgraph:v23.1.0
    container_name: orly-benchmark-dgraph-zero
    working_dir: /data/zero
    ports:
      - "5080:5080"
      - "6080:6080"
    command: dgraph zero --my=dgraph-zero:5080
    networks:
      - orly-benchmark
    healthcheck:
      test: ["CMD", "sh", "-c", "dgraph version || exit 1"]
      interval: 5s
      timeout: 3s
      retries: 3
      start_period: 5s

  dgraph-alpha:
    image: dgraph/dgraph:v23.1.0
    container_name: orly-benchmark-dgraph-alpha
    working_dir: /data/alpha
    ports:
      - "8080:8080"
      - "9080:9080"
    command: dgraph alpha --my=dgraph-alpha:7080 --zero=dgraph-zero:5080 --security whitelist=0.0.0.0/0
    networks:
      - orly-benchmark
    depends_on:
      dgraph-zero:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "sh", "-c", "dgraph version || exit 1"]
      interval: 5s
      timeout: 3s
      retries: 6
      start_period: 10s

networks:
  orly-benchmark:
    name: orly-benchmark-network
    driver: bridge
