Skip to content

Commit

Permalink
[#5]Feat: kafka&zookeeper dockerizing
Browse files Browse the repository at this point in the history
  • Loading branch information
goldapple-ce committed Jul 25, 2023
1 parent 80ae293 commit 086859d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ MYSQL_USER=port
MYSQL_PASSWORD=port0429
MYSQL_DATABASE=voilio
SPRING_DATASOURCE_PASSWORD=port0429

MONGO_INITDB_ROOT_USERNAME=port
MONGO_INITDB_ROOT_PASSWORD=port0429
MONGO_INITDB_DATABASE=voilio
63 changes: 63 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ services:
- "3306"
networks:
- app-tier

mongo-db:
container_name: db-mongo
image: mongo
restart: always
volumes:
- mongo-data:/data
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}

database-adminer:
container_name: db-adminer
Expand Down Expand Up @@ -101,12 +114,62 @@ services:
# - backend
# - frontend
# restart: always

zookeeper:
image: confluentinc/cp-zookeeper
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
kafka1:
image: confluentinc/cp-kafka
container_name: kafka1
ports:
- "8097:8097"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:8097,INTERNAL://kafka1:9092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
restart: always

kafka2:
image: confluentinc/cp-kafka
container_name: kafka2
ports:
- "8098:8098"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:8098,INTERNAL://kafka2:9092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
restart: always
kafka3:
image: confluentinc/cp-kafka
container_name: kafka3
ports:
- "8099:8099"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 3
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:8099,INTERNAL://kafka3:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
restart: always

networks:
app-tier:
driver: bridge

volumes:
mysql-data:
mongo-data:
build_folder:

0 comments on commit 086859d

Please sign in to comment.