-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (161 loc) · 5.22 KB
/
docker-compose.yml
File metadata and controls
170 lines (161 loc) · 5.22 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: week2
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
zookeeper:
image: confluentinc/cp-zookeeper:7.6.1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
healthcheck:
test: ["CMD", "sh", "-c", "echo srvr | nc -w 2 localhost 2181 | grep -q 'Mode: standalone'"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
kafka:
image: confluentinc/cp-kafka:7.6.1
depends_on:
zookeeper:
condition: service_healthy
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_MIN_INSYNC_REPLICAS: 1
ports:
- "9092:9092"
- "9093:9093"
healthcheck:
test: ["CMD", "bash", "-lc", "kafka-broker-api-versions --bootstrap-server localhost:9092 >/dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
web:
build:
context: .
dockerfile: apps/web/Dockerfile
environment:
NODE_ENV: development
NEXT_PUBLIC_API_URL: http://localhost:3001
API_URL: http://apis:3001
ports:
- "3000:3000"
volumes:
# Mount source code for hot-reloading
- ./apps/web:/app/apps/web
- ./packages:/app/packages
- ./package.json:/app/package.json
- ./tsconfig.json:/app/tsconfig.json
- ./turbo.json:/app/turbo.json
# Prevent node_modules from being overwritten
- /app/node_modules
- /app/apps/web/node_modules
- /app/apps/web/.next
depends_on:
- apis
apis:
build:
context: .
dockerfile: apps/apis/Dockerfile
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/week2
KAFKA_BROKERS: kafka:9092
JWT_SECRET: b7e2c1a4e5d6f8c9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3
ENCRYPTION_KEY: qA6yo+C7hiqrc37TqyJSeYLD0Ylcq3x3954PobZ9Dr0=
RESEND_EMAIL_KEY: re_ZvsEJWxT_39gM15qkQtcXGLnxewQ3yrf1
RESEND_FROM: mohd.baqui13@gmail.com
APP_BASE_URL: http://apis:3001
FRONTEND_URL: http://web:3000
PUBLIC_WEBHOOK_URL: ${PUBLIC_WEBHOOK_URL:-http://localhost:3001}
ports:
- "3001:3001"
volumes:
# Mount source code for hot-reloading
- ./apps/apis/src:/app/apps/apis/src
- ./apps/apis/tsconfig.json:/app/apps/apis/tsconfig.json
- ./packages:/app/packages
- ./package.json:/app/package.json
- ./tsconfig.json:/app/tsconfig.json
# Prevent node_modules from being overwritten
- /app/node_modules
- /app/apps/apis/node_modules
- /app/apps/apis/dist
depends_on:
postgres:
condition: service_started
kafka:
condition: service_healthy
processor:
build:
context: .
dockerfile: apps/processor/Dockerfile
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/week2
KAFKA_BROKERS: kafka:9092
JWT_SECRET: b7e2c1a4e5d6f8c9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3
APP_BASE_URL: http://apis:3001
FRONTEND_URL: http://web:3000
volumes:
# Mount source code for hot-reloading
- ./apps/processor/src:/app/apps/processor/src
- ./apps/processor/tsconfig.json:/app/apps/processor/tsconfig.json
- ./packages:/app/packages
- ./package.json:/app/package.json
- ./tsconfig.json:/app/tsconfig.json
# Prevent node_modules from being overwritten
- /app/node_modules
- /app/apps/processor/node_modules
- /app/apps/processor/dist
depends_on:
postgres:
condition: service_started
kafka:
condition: service_healthy
workers:
build:
context: .
dockerfile: apps/workers/Dockerfile
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/week2
KAFKA_BROKERS: kafka:9092
JWT_SECRET: b7e2c1a4e5d6f8c9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3
RESEND_EMAIL_KEY: re_ZvsEJWxT_39gM15qkQtcXGLnxewQ3yrf1
RESEND_FROM: mohd.baqui13@gmail.com
GMAIL_USER: mohd.baqui13@gmail.com
GMAIL_APP_PASSWORD: qxuxojgtyostbiyo
APP_BASE_URL: http://apis:3001
FRONTEND_URL: http://web:3000
volumes:
# Mount source code for hot-reloading
- ./apps/workers/src:/app/apps/workers/src
- ./apps/workers/tsconfig.json:/app/apps/workers/tsconfig.json
- ./packages:/app/packages
- ./package.json:/app/package.json
- ./tsconfig.json:/app/tsconfig.json
# Prevent node_modules from being overwritten
- /app/node_modules
- /app/apps/workers/node_modules
- /app/apps/workers/dist
depends_on:
postgres:
condition: service_started
kafka:
condition: service_healthy
volumes:
pgdata: