version: "2.3"
services:
  # slurm image tries connecting to elasticsearch
  elasticsearch:
    image: elasticsearch:2.3

  mysql:
    image: mysql:5.5.46
    environment:
      - MYSQL_ROOT_PASSWORD=toxic8_teary
    ports:
      - "33061:3306"

  redis:
    image: redis:6

  slurm:
    build:
      context: ../../framework/docker/integration_tests/slurm
    ports:
      - "42022:22"
    dns:
      - 10.65.4.25
      - 10.65.4.26
    dns_search:
      - zooxlabs.com
    hostname: slurm
    entrypoint: "/entrypoint.sh master"

  slurm-worker:
    build:
      context: ../../framework/docker/integration_tests/slurm
    ports:
      - "42023:22"
    dns:
      - 10.65.4.25
      - 10.65.4.26
    dns_search:
      - zooxlabs.com
    hostname: slurm-worker
    entrypoint: "/entrypoint.sh worker"

  pipedream_slurm:
    image: "docker-registry.zooxlabs.com/pipedream_slurm:latest"
    environment:
      MYSQL_POOL_SIZE: 5
      SLURM_HOST: "slurm"
      MYSQL_HOST: "mysql"
      MYSQL_PASSWORD: "toxic8_teary"
      NO_CACHING: "true"
      REDIS_HOST: "redis"
      REDIS_PREFIX: "test_"
      LDAP_PASSWORD: "${LDAP_PASSWORD}"
    entrypoint: "./entrypoint.sh"
    ports:
      - "8080:80"

  pipedream_slurm_daemon:
    image: "docker-registry.zooxlabs.com/pipedream_slurm:latest"
    environment:
      SLURM_HOST: "slurm"
      MYSQL_HOST: "mysql"
      MYSQL_PASSWORD: "toxic8_teary"
      NO_CACHING: "true"
      REDIS_HOST: "redis"
      REDIS_PREFIX: "test_"
      PIPEDREAM_CLUSTER: "test"
      LDAP_PASSWORD: "${LDAP_PASSWORD}"
    entrypoint: "./entrypoint.sh daemon"
