Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Finally, create the docker-compose.yml file:

    Code Block
    vim/opt/zw-vmmc-docker/tomcat/conf/log4j2.json
  2. And past the next content:

    Code Block
    services:
      tomcat:
        build:
          context: ./tomcat
        image: tomcat
        container_name: tomcat
        ports:
          - "8080:8080"
        volumes:
          - ./tomcat/webapps:/usr/local/tomcat/webapps/
        

...

  1. depends_on:
          - node_container
          - kafka-broker
    
        restart: unless-stopped
        networks:
          - dws-network
    
      mongo:
        image: mongo:latest
        ports:
          - "27017:27017"
        restart: unless-stopped
        networks:
          - dws-network
        environment:
          - MONGO_INITDB_ROOT_USERNAME=<user-mongo>
          - MONGO_INITDB_ROOT_PASSWORD=

...

  1. <user-mongo>
          - MONGO_INITDB_DATABASE=dev
        volumes:
          - ./mongo/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
          - ./mongo/backups:/backups

...

  1. 
          - ./mongo/entrypoint.sh:/entrypoint.sh
          - ./mongo/data:/data
    
      mongo-seed:
        image: mongo:latest
        depends_on:
          - mongo
        networks:
          - dws-network
        restart: no
        volumes:
           - ./mongo/backups:/

...

  1. backups
        

...

  1.  

...

  1.  

...

  1.  

...

  1. -

...

  1.  ./mongo

...

  1. /entrypoint.sh:/entrypoint.sh
        entrypoint: ["sh","./entrypoint.sh"]
        command: tail -f /dev/null
     
      node_container:
        build:
          context: ./node_container
        image: node_container
        container_name: node_container
        # depends_on:
        #   - mongo
        ports:
          - "3000:3000"
          - "3002:3002"
          - "3015:3015"
        volumes:
          - ./node_container/services:/usr/src/app/
        restart: unless-stopped
        networks:
          - dws-network
      
      kafka-broker:
        image: wurstmeister/kafka
        container_name: kafka-broker
        ports:
          - "9092:9092"
        environment:
          KAFKA_ADVERTISED_

...

  1. LISTENER: INSIDE_KAFKA:9092
          

...

  1. KAFKA_

...

  1. LISTENER_SECURITY_

...

  1. PROTOCOL: PLAINTEXT
    

...

  1.       

...

  1. KAFKA_LISTENER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor"
          

...

  1. KAFKA_LISTENER_NAME_INTERNAL: INSIDE_KAFKA
          

...

  1. KAFKA_LISTENER_PORT: 

...

  1. 9092
        

...

  1.   KAFKA_ADVERTISED_HOST_NAME: kafka-broker
       

...

  1.  

...

  1.   KAFKA_ZOOKEEPER_CONNECT: 

...

  1. zookeeper:2181
        

...

  1.   KAFKA_LOG_DIRS: 

...

  1. /kafka/kafka-logs
          

...

  1. KAFKA_DEFAULT_REPLICATION_FACTOR: 1
          

...

  1. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
         

...

  1.  KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
          

...

  1. KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
          

...

  1. KAFKA_DELETE_TOPIC_ENABLE: true 
        volumes:
    

...

  1.    

...

  1.    - 

...

  1. ./kafka-logs:/kafka/kafka-logs
        

...

  1. depends_on:
          

...

  1. - zookeeper
        

...

  1. restart: unless-stopped
        

...

  1. networks:
          - 

...

  1. dws-network
    
    

...

  1.  

...

  1.  

...

  1. zookeeper:
        

...

  1. image: wurstmeister/zookeeper
        container_name: 

...

  1. zookeeper
    

...

  1.   

...

  1.  

...

  1.  

...

  1. environment:
    

...

  1.  

...

  1.  

...

  1.  

...

  1.    ZOOKEEPER_SERVER_ID: 1
          

...

  1. ZOOKEEPER_LISTENER_PORT: 2181  
       

...

  1.  

...

  1. ports:
          - 

...

  1. "2181:2181"
        restart: 

...

  1. unless-stopped
        networks:
          - dws-network
    
    networks:
      dws-network:
        driver: bridge
    
  2. You will need to replace <user-mongo> and <pwd-mongo> with a username and password of your choice. Make sure the password is strong. You will find each one twice, (lines 26, 27, and 42).

...

Next: Deploy containers ➡️