-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (108 loc) · 2.6 KB
/
docker-compose.yml
File metadata and controls
118 lines (108 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
services:
backend:
build:
context: ./app-backend
dockerfile: Dockerfile
container_name: e-ticaret-backend
ports:
- '3000:3000'
depends_on:
- mongodb
- redis
environment:
- MONGO_URI=mongodb://mongodb:27017/e-ticaret
- JWT_SECRET=supersecret
volumes:
- ./app-backend:/app
frontend:
build:
context: ./app-frontend
dockerfile: Dockerfile
container_name: e-ticaret-frontend
ports:
- "8080:8080"
volumes:
- ./app-frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
- VITE_API_BASE_URL=http://localhost:3000
zookeeper:
image: bitnami/zookeeper:latest
container_name: zookeeper
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: bitnami/kafka:latest
container_name: kafka
ports:
- '9092:9092'
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://0.0.0.0:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT
- KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR=1
depends_on:
- zookeeper
healthcheck:
test: ["CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list"]
interval: 10s
timeout: 5s
retries: 3
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
payment-service:
build:
context: ./microservices/payment-service
dockerfile: Dockerfile
container_name: payment-service
ports:
- '3001:3001'
environment:
- KAFKA_BROKER=kafka:9092
depends_on:
- kafka
invoice-service:
build:
context: ./microservices/invoice-service
dockerfile: Dockerfile
container_name: invoice-service
ports:
- '3002:3002'
environment:
- KAFKA_BROKER=kafka:9092
depends_on:
- kafka
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- '27017:27017'
volumes:
- mongo-data:/data/db
seed:
build:
context: ./app-backend
dockerfile: seed.Dockerfile
container_name: seeder
depends_on:
- mongodb
environment:
- MONGO_URI=mongodb://mongodb:27017/e-ticaret
command: sh -c "node src/scripts/seed.js"
restart: "no"
volumes:
mongo-data: