-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
166 lines (156 loc) · 3.77 KB
/
compose.yml
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
services:
# Webhook service
merchant-integration-service:
container_name: merchant-integration-service
image: merchant-integration-service:1.0.0
build:
context: ./backend/merchant-integration-service
dockerfile: merchant-integration.dockerfile
ports:
- "50051:50051"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=api_key_service_db
networks:
- my-postgres-network
volumes:
- ./backend/merchant-integration-service:/app
depends_on:
- db
loan-service:
container_name: loan-service
image: loan-service:1.0.0
build:
context: .
dockerfile: ./backend/loan-service/loan.dockerfile
ports:
- "50052:50051"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=loan_service_db
networks:
- my-postgres-network
volumes:
- ./backend/loan-service:/app
depends_on:
- db
credit-service:
container_name: credit-service
image: credit-service:1.0.0
build:
context: .
dockerfile: ./backend/credit-service/credit.dockerfile
ports:
- "50053:50051"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=credit_service_db
networks:
- my-postgres-network
volumes:
- ./backend/credit-service:/app
depends_on:
- db
# New user-service
user-service:
container_name: user-service
image: user-service:1.0.0
build:
context: ./backend/user-service
dockerfile: user.dockerfile
ports:
- 4001:4000
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/user_service_db
- FLASK_ENV=development
- FLASK_DEBUG=1
networks:
- my-postgres-network
volumes:
- ./backend/user-service:/app
depends_on:
- db
# API Gateway service
api-gateway:
container_name: api-gateway
image: api-gateway:1.0.0
build:
context: .
dockerfile: ./backend/api-gateway/api_gateway.dockerfile
ports:
- 8080:8080
environment:
- JWT_SECRET=your-secret-key
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=yourredispassword
networks:
- my-postgres-network
volumes:
- ./backend/api-gateway:/app # Mount local backend directory to the container for hot reload
depends_on:
- redis
- db
# db service
db:
container_name: db
image: postgres:13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
networks:
- my-postgres-network
volumes:
- pgdata:/var/lib/postgresql/data
# Add this new Redis service
redis:
image: redis:6.2-alpine
container_name: redis
restart: always
ports:
- '6379:6379'
networks:
- my-postgres-network
command: redis-server --save 20 1 --loglevel warning --requirepass yourredispassword
volumes:
- redis_data:/data
# nextjs service
# nextapp:
# container_name: nextapp
# image: nextapp:1.0.0
# build:
# context: ./example-merchant-frontend
# dockerfile: next.dockerfile
# ports:
# - 3000:3000
# environment:
# - NEXT_PUBLIC_API_URL=http://api-gateway:8080
# depends_on:
# - api-gateway
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: user@domain.com
PGADMIN_DEFAULT_PASSWORD: SuperSecret
ports:
- "80:80"
networks:
- my-postgres-network
volumes:
pgdata: {}
redis_data: {} # Add this new volume for Redis data persistence
networks:
my-postgres-network:
driver: bridge