Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker compose fix #179

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.env.sample
/src/node_modules
.env.sample
.env
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ Elevate services can be setup in local using three methods:
### Steps

1. Install **Docker** & **Docker-Compose**.
2. Clone all elevate services into a common directory.

2. To create/start all containers:

```
./ELEVATE/
├── mentoring
├── notification
├── scheduler
└── user
ELEVATE/mentoring$ docker-compose up
```
3. To create/start all containers:

You can pass .env file to docker images of elevate service by using the below command

```
ELEVATE/mentoring$ docker-compose up
ELEVATE/mentoring$ mentoring_env=".env path" users_env=".env path" notification_env=".env path" scheduler=".env path" docker-compose up

```

4. To remove all containers & networks:
3. To remove all containers & networks:

```
ELEVATE/mentoring$ docker-compose down
Expand Down
72 changes: 31 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
version: '3'
services:
zookeeper:
image: 'bitnami/zookeeper:3.8.0'
image: 'confluentinc/cp-zookeeper:7.3.0'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
- ZOOKEEPER_CLIENT_PORT=2181
- ZOOKEEPER_TICK_TIME=2000
networks:
- elevate_net
volumes:
- zookeeper-data:/bitnami/zookeeper
logging:
driver: none
kafka:
image: 'bitnami/kafka:3.1.0'
image: 'confluentinc/cp-kafka:7.3.0'
ports:
- '9092:9092'
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
depends_on:
- zookeeper
networks:
- elevate_net
volumes:
- kafka-data:/bitnami/kafka
logging:
driver: gelf
options:
Expand All @@ -48,7 +45,6 @@ services:
volumes:
- mongo-data:/data/db
- logs:/var/log/mongodb

redis:
image: 'redis:7.0.0'
restart: 'always'
Expand All @@ -64,10 +60,7 @@ services:
gelf-address: 'udp://0.0.0.0:12201'
tag: 'redis-logs'
mentoring:
build: './'
image: elevate/mentoring:1.0
volumes:
- ./src/:/var/src
image: shikshalokamqa/elevate-mentoring:2.2
ports:
- '3000:3000'
command: ['nodemon', 'app.js']
Expand All @@ -82,11 +75,10 @@ services:
- redis
networks:
- elevate_net
env_file:
- ${mentoring_env}
user:
build: '../user/'
image: elevate/user:1.0
volumes:
- ../user/src/:/var/src
image: shikshalokamqa/elevate-user:2.2
ports:
- '3001:3001'
command: ['nodemon', 'app.js']
Expand All @@ -100,33 +92,32 @@ services:
- redis
networks:
- elevate_net
env_file:
- ${users_env}
notification:
build: '../notification/'
image: elevate/notification:1.0
volumes:
- ../notification/src/:/var/src
image: shikshalokamqa/elevate-notification:2.2
ports:
- '3002:3002'
command: ['nodemon', 'app.js']
environment:
- KAFKA_HOST=kafka:9092
depends_on:
- kafka
- mongo
networks:
- elevate_net
env_file:
- ${notification_env}

scheduler:
build: '../scheduler/'
image: elevate/scheduler:1.0
volumes:
- ../scheduler/src/:/var/src
image: shikshalokamqa/elevate-scheduler:2.2
ports:
- '4000:4000'
command: ['nodemon', 'app.js']
environment:
- KAFKA_URL=kafka:9092
- MONGODB_URL=mongodb://mongo:27017/elevate-scheduler
env_file:
- ${scheduler_env}
depends_on:
- kafka
- mongo
Expand Down Expand Up @@ -211,13 +202,12 @@ services:
- elasticsearch
- mentoring
- user

networks:
elevate_net:
external: false
volumes:
zookeeper-data:
kafka-data:
mongo-data:
fbdata:
logs:
networks:
elevate_net:
external: false
volumes:
zookeeper-data:
kafka-data:
mongo-data:
fbdata:
logs: