-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
205 lines (195 loc) · 5.33 KB
/
docker-compose.yml
File metadata and controls
205 lines (195 loc) · 5.33 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
networks:
squareme:
driver: bridge
volumes:
postgres_data:
redis_data:
rabbitmq_data:
services:
postgres:
profiles: ['backing-service', 'all', 'dev', 'api']
image: postgres:16.4-alpine
container_name: square_me_microservices_postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: example
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/initdb:/docker-entrypoint-initdb.d
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
networks:
- squareme
redis:
profiles: ['backing-service', 'all', 'dev', 'api']
image: redis:latest
container_name: square_me_microservices_redis
command: redis-server --requirepass mypassword --port 6379 --databases 1
ports:
- '6379:6379'
volumes:
- redis_data:/data
networks:
- squareme
rabbitmq:
profiles: ['backing-service', 'api', 'all', 'dev']
image: rabbitmq:3.11-management
container_name: square_me_rabbitmq
ports:
- '5672:5672'
- '15672:15672'
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- squareme
mailhog:
profiles: ['backing-service', 'api', 'all']
image: mailhog/mailhog:latest
container_name: square_me_mailhog
platform: linux/amd64
restart: always
ports:
- '1025:1025'
- '8025:8025'
environment:
MH_STORAGE: memory
networks:
- squareme
auth:
profiles: ['all', 'api']
build:
context: .
dockerfile: ./apps/auth/Dockerfile
container_name: square_me_auth
ports:
- '3000:3000'
- '3333:3333'
environment:
PORT: 3000
SWAGGER_PATH: 'swagger'
SWAGGER_TITLE: 'Auth Service'
SWAGGER_DESCRIPTION: 'Manages user and authentication'
CORS_ORIGINS: transaction:3001
JWT_SECRET: TDCYJMDvpGdL+t5qn8nKSQ2NGAM6UL9+QnPy87Ehrlw=
JWT_EXPIRATION_MS: 28800000
AUTH_GRPC_SERVICE_URL: auth:3333
WALLET_GRPC_SERVICE_URL: wallet:7777
INTEGRATION_GRPC_URL: integration:4444
SERVICE_ENTITY_PREFIX: 'auth-service-'
DATABASE_URL: postgres://postgres:example@postgres:5432/auth
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
networks:
- squareme
integration:
profiles: ['all', 'api']
build:
context: .
dockerfile: ./apps/integration/Dockerfile
container_name: square_me_integration
ports:
- '4444:4444'
environment:
PORT: 4444
EXCHANGE_RATE_URL: 'https://v6.exchangerate-api.com'
WALLET_GRPC_SERVICE_URL: wallet:7777
INTEGRATION_GRPC_URL: integration:4444
SERVICE_ENTITY_PREFIX: 'integration-service-'
REDIS_URL: redis://:mypassword@redis:6379/0
env_file: ./apps/integration/docker.env
depends_on:
redis:
condition: service_started
networks:
- squareme
notification:
profiles: ['all', 'api']
build:
context: .
dockerfile: ./apps/notification/Dockerfile
container_name: square_me_notification
ports:
- '5555:5555'
environment:
PORT: 5555
RABBIT_MQ_URL: amqp://guest:guest@rabbitmq:5672
RABBIT_MQ_QUEUE_NAME: email-queue
EMAIL_HOST: mailhog
EMAIL_PORT: 1025
EMAIL_FROM: 'Square Me <help@square-me.com>'
EMAIL_USERNAME: mailhog
EMAIL_PASSWORD: mailhog
depends_on:
rabbitmq:
condition: service_started
mailhog:
condition: service_started
networks:
- squareme
transaction:
profiles: ['all', 'api']
build:
context: .
dockerfile: ./apps/transaction/Dockerfile
container_name: square_me_transaction
ports:
- '3001:3001'
environment:
PORT: 3001
SWAGGER_PATH: swagger
SWAGGER_TITLE: 'Transaction Service'
SWAGGER_DESCRIPTION: 'Orchestrates creation of order, debiting of wallet and sending notification'
CORS_ORIGINS: auth:3333
WALLET_GRPC_SERVICE_URL: wallet:7777
AUTH_GRPC_SERVICE_URL: auth:3333
INTEGRATION_GRPC_URL: integration:4444
DATABASE_URL: postgres://postgres:example@postgres:5432/transaction?schema=public
SERVICE_ENTITY_PREFIX: transaction-service-
REDIS_URL: redis://:mypassword@redis:6379/0
RABBIT_MQ_URL: amqp://guest:guest@rabbitmq:5672
RABBIT_MQ_QUEUE_NAME: email-queue
depends_on:
auth:
condition: service_started
wallet:
condition: service_started
integration:
condition: service_started
postgres:
condition: service_healthy
redis:
condition: service_started
rabbitmq:
condition: service_started
networks:
- squareme
wallet:
profiles: ['all', 'api']
build:
context: .
dockerfile: ./apps/wallet/Dockerfile
container_name: square_me_wallet
ports:
- '7777:7777'
environment:
PORT: 7777
DATABASE_URL: postgres://postgres:example@postgres:5432/wallet?schema=public
WALLET_GRPC_SERVICE_URL: wallet:7777
INTEGRATION_GRPC_URL: integration:4444
SERVICE_ENTITY_PREFIX: wallet-service-
depends_on:
postgres:
condition: service_healthy
networks:
- squareme