version: "3.2"

services:

  nginx:
    container_name: itdevcon-nginx
    image: nginx:latest
    restart: unless-stopped
    ports:
      - 8080:80
      - 8443:443
    volumes:
      - ./web-page:/usr/share/nginx/html
    hostname: itdevcon_nginx
     
  rabbitmq:
    container_name: itdevcon-rabbitmq
    build: ./rabbitmq
    image: rabbitmq:3.8-management
    environment:
      - RABBITMQ_DEFAULT_USER=root
      - RABBITMQ_DEFAULT_PASS=itdevcon
    ports:
        - 5672:5672
        - 15672:15672
        - 15692:15692
        - 61613:61613
    hostname: itdevcon-rabbitmq
    networks:
        - itdevcon_network
        
  mongodb:
    container_name: itdevcon-mongo
    image: mongo:latest
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: itdevcon
    ports:
      - 27017:27017
    hostname: itdevcon-mongo
    networks:
        - itdevcon_network

  webapi:
    container_name: itdevcon-webapi-dmvc
    build: ./web-api
    image: itdevcon-webapi-dmvc
    ports:
      - 8090:8090
    hostname: itdevcon-webapi-dmvc
    networks:
        - itdevcon_network

  job-protocol:
    container_name: itdevcon-job-protocol
    build: ./job-protocol
    image: itdevcon-job-protocol
    hostname: itdevcon-job-protocol
    depends_on:
      - rabbitmq
      - mongodb
    networks:
        - itdevcon_network

  job-reporter:
    container_name: itdevcon-job-reporter
    build: ./job-reporter
    image: itdevcon-job-reporter
    hostname: itdevcon-job-reporter
    depends_on:
      - rabbitmq
      - mongodb
    volumes:
      - ./@data/pdf:/data
    networks:
        - itdevcon_network

networks:
  itdevcon_network:
    driver: bridge
