version: "3"
services:
  # Alacris services
  alacris_private_ethereum_node: # Ethereum test network and block explorer
    image: gcr.io/legicash-demo-1950/legicash-demo/alacris_private_ethereum_node:v1
    hostname: "alacris-private-ethereum-node"
    container_name: "alacris-private-ethereum-node"
    volumes:
      - /tmp/legilogic/alacris-private-ethereum-node/_ethereum:/var/www/app/alacris-private-ethereum-node/_ethereum
      - /tmp/legilogic/alacris-private-ethereum-node/_run:/var/www/app/alacris-private-ethereum-node/_run
    networks:
      legicash-demo:
        ipv4_address: 10.5.0.4
    ports:
      - "8000:8000"
      - "8545:8545"

  alacris_side_chain_manager: # Legicash-facts side chain server
    build:
      context: ..
      dockerfile: docker/containers/alacris_side_chain_manager/Dockerfile
    image: gcr.io/legicash-demo-1950/legicash-demo/alacris_side_chain_manager:${TAG:-v1.1}
    hostname: "alacris-side-chain-manager"
    container_name: "alacris-side-chain-manager"
    environment:
      - ALACRIS_HOME=/var/www/app/legicash-facts
    volumes:
      - /tmp/legilogic/alacris_side_chain_manager/_run:/var/www/app/legicash-facts/_run
      - /tmp/legilogic/config/:/var/www/app/legicash-facts/config/
    networks:
      legicash-demo:
        ipv4_address: 10.5.0.5
    ports:
      - "8095:8095"
    depends_on:
    - "alacris_private_ethereum_node"

  alacris_client: # Legicash-facts application, nginx and scgi/side chain
    build:
      context: ..
      dockerfile: docker/containers/alacris_client/Dockerfile
    image: gcr.io/legicash-demo-1950/legicash-demo/alacris_client:${TAG:-v1.1}
    hostname: "alacris-client"
    container_name: "alacris-client"
    volumes:
      - /tmp/legilogic/alacris_client/_run:/var/www/app/legicash-facts/_run
      - /tmp/legilogic/config/:/var/www/app/legicash-facts/config/
    networks:
      legicash-demo:
        ipv4_address: 10.5.0.6
    ports:
      - "8081:8081"
    depends_on:
    - "alacris_side_chain_manager"

  alacris_frontend: # Legicash react frontend app
    image: gcr.io/legicash-demo-1950/legicash-demo/alacris_frontend:v1
    hostname: "alacris-frontend"
    container_name: "alacris-frontend"
    networks:
      legicash-demo:
        ipv4_address: 10.5.0.7
    ports:
      - "8800:8800"
    depends_on:
    - "alacris_side_chain_manager"

  #  stress_tester: # Locust master container
  #    build: containers/stress_tester
  #    image: gcr.io/legicash-demo-1950/legicash-demo/stress_tester:${TAG:-v1.1}
  #    hostname: "stress-tester"
  #    container_name: "stress-tester"
  #    environment:
  #      - ATTACKED_HOST=http://alacris-client:8081
  #      - LOCUST_MODE=standalone
  #    volumes:
  #      - ./containers/stress_tester/files:/stress_tester
  #    networks:
  #      legicash-demo:
  #        ipv4_address: 10.5.0.7
  #    ports:
  #      - "8089:8089"
  #      - "5557:5557"
  #      - "5558:5558"

networks:
  legicash-demo:
    ipam:
      driver: default
      config:
        - subnet: 10.5.0.0/24
