Skip to content

Commit f5833c7

Browse files
authored
Update docker-compose.yml
1 parent 10aaf87 commit f5833c7

File tree

1 file changed

+43
-34
lines changed

1 file changed

+43
-34
lines changed

docker-compose.yml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
1-
version: '3.8'
1+
version: "3.9"
22

33
services:
4-
zookeeper:
5-
image: bitnami/zookeeper:latest
6-
environment:
7-
- ALLOW_ANONYMOUS_LOGIN=yes
4+
# ---------------------------------------------------------
5+
# DRIVER LOCATION SERVICE
6+
# ---------------------------------------------------------
7+
driver-location:
8+
build:
9+
context: .
10+
dockerfile: src/driver-location-service/Dockerfile
11+
container_name: driver-location-service
812
ports:
9-
- "2181:2181"
13+
- "8003:8003"
14+
restart: unless-stopped
15+
healthcheck:
16+
test: ["CMD", "curl", "-f", "http://localhost:8003/docs"]
17+
interval: 10s
18+
timeout: 3s
19+
retries: 5
20+
networks:
21+
- ride-net
1022

11-
kafka:
12-
image: bitnami/kafka:latest
13-
environment:
14-
- KAFKA_BROKER_ID=1
15-
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
16-
- ALLOW_PLAINTEXT_LISTENER=yes
23+
# ---------------------------------------------------------
24+
# DISPATCH SERVICE
25+
# ---------------------------------------------------------
26+
dispatch:
27+
build:
28+
context: .
29+
dockerfile: src/dispatch-service/Dockerfile
30+
container_name: dispatch-service
1731
ports:
18-
- "9092:9092"
32+
- "8002:8002"
33+
restart: unless-stopped
1934
depends_on:
20-
- zookeeper
35+
driver-location:
36+
condition: service_healthy
37+
healthcheck:
38+
test: ["CMD", "curl", "-f", "http://localhost:8002/docs"]
39+
interval: 10s
40+
timeout: 3s
41+
retries: 5
42+
networks:
43+
- ride-net
2144

22-
backend:
23-
build: .
24-
container_name: ride_sharing_backend
25-
command: bash run_pipeline.sh
26-
environment:
27-
- KAFKA_BOOTSTRAP_SERVERS=kafka:9092
28-
- DB_URL=postgres://user:password@db:5432/rides
29-
depends_on:
30-
- kafka
31-
- db
32-
volumes:
33-
- .:/app
3445

35-
db:
36-
image: postgres:13
37-
environment:
38-
POSTGRES_USER: user
39-
POSTGRES_PASSWORD: password
40-
POSTGRES_DB: rides
41-
ports:
42-
- "5432:5432"
46+
# -----------------------------------------------------------
47+
# DOCKER NETWORKS
48+
# -----------------------------------------------------------
49+
networks:
50+
ride-net:
51+
driver: bridge

0 commit comments

Comments
 (0)