version: '2'

services:
    mongo:
        image: mongo:3
        ports:
            - "127.0.0.1:27017:27017"
        command: "mongod --port 27017"
        restart: always
    
    rabbit:
        image: rabbitmq:3-management
        ports:
            - "127.0.0.1:5671-5672:5671-5672"
            - "127.0.0.1:15671:15671"
        restart: always
    
    drip-planner:
        depends_on:
            - rabbit
        build:
            context: ./planner
            dockerfile: Dockerfile
        image: drip-planner:latest
        restart: always
        environment:
            RABBITMQ_HOST: rabbit
            
    drip-provisioner:
        depends_on:
            - rabbit
        build:
            context: ./provisioner
            dockerfile: Dockerfile
        image: drip-provisioner:latest
        restart: always
        environment:
            RABBITMQ_HOST: rabbit      
            
    drip-deployer:
        depends_on:
            - rabbit
        build:
            context: ./deployer
            dockerfile: Dockerfile
        image: drip-deployer:latest
        restart: always
        environment:
            RABBITMQ_HOST: rabbit 
            
    drip-manager:
        depends_on:
            - rabbit
            - mongo
        build:
            context: ./manager
            dockerfile: Dockerfile
        image: drip-manager:latest
        restart: always
        environment:
            RABBITMQ_HOST: rabbit
            MONOG_HOST: mongo
        env_file:
            - ./env_file
        ports:
            - "8443:8443"
#docker-compose build
#docker-compose up -d



