version: '2'
services:
  merchant-backend:
    image: 192.168.4.36/java/merchant-backend
    domainname: merchantapi.xyqb.com
    ports:
     - "7038:7038"
    tty: true
    depends_on:
     - db
     - redis
     - rabbitmq
    environment:
     - SYSTEM_NAME=merchant-backend
     - SYSTEM_PORT=7038
     - REDIS_MASTER_HOST=redis
     - DB_PORT_3306_TCP_ADDR=db
     - DB_PORT_3306_TCP_PORT=3306
     - DB_ENV_MYSQL_DATABASE=merchant-backend
     - DB_ENV_MYSQL_USER=qa
     - DB_ENV_MYSQL_PASSWORD=qatest
     - RABBIT_MQ_HOST=rabbitmq
     - RABBIT_MQ_PORT=5672
     - REDIS_PORT=6379
    networks:
      - front-tier
      - back-tier
  merchant-op-ui:
    image: 192.168.4.36/ui/merchant-op-ui
    ports:
     - "80:80"
    depends_on:
     - merchant-backend
    networks:
     - front-tier
  db:
    image: 192.168.4.36/baseimg/mysql:5.6
    environment:
     - MYSQL_ROOT_PASSWORD=Quantgroup2017
     - MYSQL_DATABASE=db
     - MYSQL_USER=qa
     - MYSQL_PASSWORD=qatest
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    ports:
     - "3306:3306"
    volumes:
     - /home/quant_group/docker_disk/mysql/data:/var/lib/mysql
    networks:
     - back-tier
  redis:
    image: 192.168.4.36/baseimg/redis
    ports: 
      - "6379:6379"
    networks:
      - back-tier
  rabbitmq:
    image: 192.168.4.36/baseimg/rabbit_mq
    hostname: rabbitmq
    environment:
      RABBITMQ_DEFAULT_USER: "qa"
      RABBITMQ_DEFAULT_PASS: "qatest"
      RABBITMQ_DEFAULT_VHOST: "/"
    ports:
      - "15672:15672"
      - "5672:5672"
    labels:
      NAME: "rabbitmq-merchant-backend"
    networks:
      - back-tier
networks:
  front-tier:
    driver: bridge
  back-tier:
    driver: bridge