-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
280 lines (265 loc) · 6.89 KB
/
docker-compose.yml
File metadata and controls
280 lines (265 loc) · 6.89 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: crm_db
POSTGRES_USER: crm_user
POSTGRES_PASSWORD: crm_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./database/migrations:/docker-entrypoint-initdb.d/migrations
networks:
- crm-network
# Redis for caching and queues
redis:
image: redis:7-alpine
ports:
- "6379:6379"
networks:
- crm-network
# API Gateway
api-gateway:
build:
context: ./api-gateway
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
environment:
NODE_ENV: development
JWT_SECRET: your-super-secret-jwt-key
USERS_SERVICE_URL: http://users-service:3001
NOTES_SERVICE_URL: http://notes-service:3003
PRODUCTS_SERVICE_URL: http://products-service:3004
CONTACTS_SERVICE_URL: http://contacts-service:3005
QUOTES_SERVICE_URL: http://quotes-service:3006
SERVICES_SERVICE_URL: http://services-service:3007
PRICING_SERVICES_SERVICE_URL: http://pricing-services-service:3009
INVOICES_SERVICE_URL: http://invoices-service:3008
OCR_SERVICE_URL: http://ocr-service:8000
REDIS_URL: redis://redis:6379
volumes:
- ./api-gateway/src:/app/src
- ./api-gateway/package.json:/app/package.json
- ./api-gateway/tsconfig.json:/app/tsconfig.json
depends_on:
- redis
- users-service
- notes-service
- products-service
- contacts-service
- quotes-service
- services-service
- ocr-service
networks:
- crm-network
# Users Microservice
users-service:
build:
context: ./users-service
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
JWT_SECRET: your-super-secret-jwt-key
REDIS_URL: redis://redis:6379
PORT: 3001
depends_on:
- postgres
- redis
networks:
- crm-network
# Notes Microservice
notes-service:
build:
context: ./notes-service
dockerfile: Dockerfile
ports:
- "3003:3003"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
REDIS_URL: redis://redis:6379
PORT: 3003
depends_on:
- postgres
- redis
networks:
- crm-network
# Products Microservice
products-service:
build:
context: ./products-service
dockerfile: Dockerfile
ports:
- "3004:3004"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
PORT: 3004
depends_on:
- postgres
networks:
- crm-network
# Contacts Microservice (formerly Leads)
contacts-service:
build:
context: ./contacts-service
dockerfile: Dockerfile
ports:
- "3005:3005"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: crm_user
DB_PASSWORD: crm_password
DB_NAME: crm_db
PORT: 3005
CORS_ORIGIN: http://localhost:3001
depends_on:
- postgres
networks:
- crm-network
# Quotes Microservice
quotes-service:
build:
context: ./quotes-service
dockerfile: Dockerfile.dev
ports:
- "3006:3006"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: crm_user
DB_PASSWORD: crm_password
DB_NAME: crm_db
PORT: 3006
JWT_SECRET: your-super-secret-jwt-key
SERVICES_SERVICE_URL: http://services-service:3007
volumes:
- ./quotes-service/src:/app/src
- ./quotes-service/package.json:/app/package.json
- ./quotes-service/tsconfig.json:/app/tsconfig.json
- ./quotes-service/tsconfig.build.json:/app/tsconfig.build.json
depends_on:
- postgres
- services-service
networks:
- crm-network
# Services Microservice
services-service:
build:
context: ./services-service
dockerfile: Dockerfile
ports:
- "3007:3007"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: crm_user
DB_PASSWORD: crm_password
DB_NAME: crm_db
PORT: 3007
depends_on:
- postgres
networks:
- crm-network
# Pricing Services Microservice
pricing-services-service:
build:
context: ./pricing-services-service
dockerfile: Dockerfile
ports:
- "3009:3009"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: crm_user
DB_PASSWORD: crm_password
DB_NAME: crm_db
PORT: 3009
JWT_SECRET: your-super-secret-jwt-key
SERVICES_SERVICE_URL: http://services-service:3007
REDIS_URL: redis://redis:6379
depends_on:
- postgres
- redis
- services-service
networks:
- crm-network
# Invoices Microservice
invoices-service:
build:
context: ./invoices-service
dockerfile: Dockerfile
ports:
- "3008:3008"
environment:
NODE_ENV: development
DATABASE_URL: postgresql://crm_user:crm_password@postgres:5432/crm_db
DB_HOST: postgres
DB_PORT: 5432
DB_USERNAME: crm_user
DB_PASSWORD: crm_password
DB_NAME: crm_db
PORT: 3008
JWT_SECRET: your-super-secret-jwt-key
SERVICES_SERVICE_URL: http://services-service:3007
PRODUCTS_SERVICE_URL: http://products-service:3004
CONTACTS_SERVICE_URL: http://contacts-service:3005
REDIS_URL: redis://redis:6379
depends_on:
- postgres
- redis
- services-service
- products-service
- contacts-service
networks:
- crm-network
# OCR Microservice (Python FastAPI)
ocr-service:
build:
context: ./ocr-service
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
JWT_SECRET: your-super-secret-jwt-key
PYTHONPATH: /app
PYTHONUNBUFFERED: 1
volumes:
- ./ocr-service/uploads:/app/uploads
networks:
- crm-network
# Frontend Next.js App
frontend:
build:
context: ./frontend-next
dockerfile: Dockerfile
ports:
- "3333:3000"
environment:
NEXT_PUBLIC_API_BASE_URL: http://localhost:3000/api
NEXT_PUBLIC_APP_URL: http://localhost:3333
depends_on:
- api-gateway
networks:
- crm-network
volumes:
postgres_data:
networks:
crm-network:
driver: bridge