Skip to content

Commit

Permalink
Merge pull request #4 from mojaloop/fix/upgrade-mongo-kafaka-to-run-i…
Browse files Browse the repository at this point in the history
…n-all-machines

fix: upgraded mongo and kafaka to run in all machines without issues
  • Loading branch information
vijayg10 authored Apr 4, 2023
2 parents 8c322a5 + 437f284 commit 35276b2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 261 deletions.
72 changes: 46 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ services:
image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION}
container_name: central-ledger
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-ledger.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/api/index.js"
ports:
- "3001:3001"
# ports:
# - "3001:3001"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
Expand Down Expand Up @@ -43,17 +43,14 @@ services:
- all-services

objstore:
image: mongo:latest
image: mongo:6.0.5
container_name: objstore
# Disable logging, this container is not that important and rather verbose
logging:
driver: none
ports:
- "27017:27017"
networks:
- mojaloop-net
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
Expand All @@ -65,20 +62,43 @@ services:
- agreement
- all-services

zookeeper:
networks:
- mojaloop-net
image: docker.io/bitnami/zookeeper:3.8
container_name: zookeeper
ports:
- 2181:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
profiles:
- central-ledger
- transfer
- discovery
- agreement
- all-services

kafka:
image: johnnypark/kafka-zookeeper:2.3.0
networks:
- mojaloop-net
image: docker.io/bitnami/kafka:3.2
container_name: kafka
volumes:
- ./docker/kafka/:/opt/kafka_2.12-2.3.0/config/
ports:
- "2181:2181"
- "9092:9092"
environment:
- ZOO_LOG4J_PROP=WARN
networks:
- mojaloop-net
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_INTERN://kafka:9093,LISTENER_EXTERN://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_INTERN://kafka:9093,LISTENER_EXTERN://127.0.0.1:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER:PLAINTEXT,LISTENER_INTERN:PLAINTEXT,LISTENER_EXTERN:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_INTERN
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CFG_MESSAGE_MAX_BYTES: 200000000
depends_on:
- zookeeper
healthcheck:
test: ["CMD" ,"/opt/kafka_2.12-2.3.0/bin/kafka-broker-api-versions.sh","--bootstrap-server","kafka:29092"]
test: ["CMD" ,"/opt/bitnami/kafka/bin/kafka-broker-api-versions.sh","--bootstrap-server","kafka:9092"]
timeout: 20s
retries: 10
start_period: 40s
Expand All @@ -94,7 +114,7 @@ services:
image: mysql/mysql-server
container_name: mysql
ports:
- "3307:3306"
- "3306:3306"
volumes:
# Note: this fixes the permissions issue, but docker-compose up will fail on first attempt
- ./docker/sql-init/:/docker-entrypoint-initdb.d/
Expand Down Expand Up @@ -129,8 +149,8 @@ services:
condition: service_started
central-ledger:
condition: service_started
ports:
- "3002:3002"
# ports:
# - "3002:3002"
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
healthcheck:
Expand All @@ -148,8 +168,8 @@ services:
image: mojaloop/ml-api-adapter:${ML_API_ADAPTER_VERSION}
container_name: ml-api-adapter
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/ml-api-adapter.js /opt/app/config/default.json && /opt/app/wait4/wait4.js ml-api-adapter && node src/api/index.js"
ports:
- "3000:3000"
# ports:
# - "3000:3000"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
Expand Down Expand Up @@ -177,8 +197,8 @@ services:
simulator:
image: mojaloop/simulator:v11.1.3
container_name: simulator
ports:
- "8444:8444"
# ports:
# - "8444:8444"
environment:
- LOG_LEVEL=info
- TRANSFERS_ENDPOINT=http://ml-api-adapter:3000
Expand All @@ -202,9 +222,9 @@ services:
image: mojaloop/account-lookup-service:${ACCOUNT_LOOKUP_SERVICE_VERSION}
container_name: account-lookup-service
command: sh -c "/opt/account-lookup-service/config-modifier/run.js /opt/account-lookup-service/config/default.json /opt/account-lookup-service/config-modifier/configs/account-lookup-service.js /opt/account-lookup-service/config/default.json && /opt/account-lookup-service/wait4/wait4.js account-lookup-service && npm run migrate && node src/index.js server"
ports:
- "4001:4001"
- "4002:4002"
# ports:
# - "4001:4001"
# - "4002:4002"
environment:
- LOG_LEVEL=debug
- ALS_DISPLAY_ROUTES=false
Expand Down Expand Up @@ -234,7 +254,7 @@ services:
image: mysql/mysql-server
container_name: mysql-als
ports:
- "3306:3306"
- "3307:3306"
volumes:
- ./docker/sql-als-init/:/docker-entrypoint-initdb.d/
environment:
Expand Down
26 changes: 0 additions & 26 deletions docker/kafka/consumer.properties

This file was deleted.

45 changes: 0 additions & 45 deletions docker/kafka/producer.properties

This file was deleted.

143 changes: 0 additions & 143 deletions docker/kafka/server.properties

This file was deleted.

21 changes: 0 additions & 21 deletions docker/kafka/tools-log4j.properties

This file was deleted.

0 comments on commit 35276b2

Please sign in to comment.