-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
301 lines (301 loc) · 10.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
301 lines (301 loc) · 10.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
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
services:
###############################################################################
# Redis
###############################################################################
redis:
image: redis:7.4-bookworm
environment:
REDIS_PORT: 6379
expose:
- '6379'
volumes:
- ./data/redis:/data
command: [
'sh',
'-c',
'docker-entrypoint.sh --requirepass ${REDIS_PASSWORD:-redis_password} --loglevel warning'
] # Change password in production
networks:
- net
###############################################################################
# Mongo
###############################################################################
mongo:
image: mongo:7
environment:
MONGO_PORT: 27017
command: --quiet --logpath /dev/null
expose:
- '27017'
volumes:
- ./data/mongodb:/data/db
- ./backup:/backup
networks:
- net
###############################################################################
# Reverse Proxy
###############################################################################
reverse-proxy:
image: caddy:latest
profiles:
- ''
command: caddy reverse-proxy --from ${APP_PROTOCOL:-http}://${APP_DOMAIN:-localhost} --to gateway:8080
ports:
- ${APP_PORT:-80}:${APP_PORT:-80}
- 443:443
networks:
- net
###############################################################################
# Gateway
###############################################################################
gateway:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/gateway:${MRE_VERSION:-latest}'
environment:
NODE_ENV: production
LOGGER_LEVEL: info
PORT: 8080
EXPOSE_FRONTENDS: 'true'
AUTHENTICATOR_URL: http://authenticator:8000
API_URL: http://api:8200/api/v2
PDFGENERATOR_URL: http://pdfgenerator:8300/pdfgenerator
EMAILER_URL: http://emailer:8400/emailer
LANDLORD_FRONTEND_URL: http://landlord-frontend:8180
LANDLORD_BASE_PATH: /landlord
TENANT_FRONTEND_URL: http://tenant-frontend:8190
TENANT_BASE_PATH: /tenant
APP_DOMAIN: ${APP_DOMAIN:-localhost}:${APP_PORT}
CORS_ENABLED: 'true'
TENANTAPI_URL: http://tenantapi:8250/tenantapi
ports:
- '8080:8080'
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- net
depends_on:
authenticator:
condition: service_started
api:
condition: service_started
tenantapi:
condition: service_started
pdfgenerator:
condition: service_started
emailer:
condition: service_started
###############################################################################
# Authenticator
###############################################################################
authenticator:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/authenticator:${MRE_VERSION:-latest}'
environment:
NODE_ENV: production
PORT: 8000
LOGGER_LEVEL: info
REDIS_URL: redis://redis
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis_password} # Change password in production
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET:-access_token_secret} # Change secret in production
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET:-refresh_token_secret} # Change secret in production
RESET_TOKEN_SECRET: ${RESET_TOKEN_SECRET:-reset_token_secret} # Change secret in production
APPCREDZ_TOKEN_SECRET: ${APPCREDZ_TOKEN_SECRET:-appcredz_token_secret} # Change secret in production
MONGO_URL: ${MONGO_URL:-mongodb://mongo/mredb}
EMAILER_URL: http://emailer:8400/emailer
SIGNUP: 'true'
APP_DOMAIN: ${APP_DOMAIN:-localhost} # do not pass APP_PORT here
APP_PROTOCOL: ${APP_PROTOCOL:-http}
expose:
- '8000'
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- net
depends_on:
redis:
condition: service_started
mongo:
condition: service_started
emailer:
condition: service_started
###############################################################################
# PDFGenerator
###############################################################################
pdfgenerator:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/pdfgenerator:${MRE_VERSION:-latest}'
environment:
NODE_ENV: production
PORT: 8300
LOGGER_LEVEL: info
MONGO_URL: ${MONGO_URL:-mongodb://mongo/mredb}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET:-access_token_secret} # Change secret in production
CIPHER_KEY: ${CIPHER_KEY:-cipher_key} # Change key in production
CIPHER_IV_KEY: ${CIPHER_IV_KEY:-cipher_iv_key} # Change key in production
UPLOAD_MAX_SIZE: 2000000000 # ~2Gb
expose:
- '8300'
networks:
- net
depends_on:
mongo:
condition: service_started
###############################################################################
# Emailer
###############################################################################
emailer:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/emailer:${MRE_VERSION:-latest}'
environment:
NODE_ENV: production
ALLOW_SENDING_EMAILS: 'true'
PORT: 8400
LOGGER_LEVEL: info
LANDLORD_APP_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN:-localhost}:${APP_PORT}/landlord
TENANT_APP_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN:-localhost}:${APP_PORT}/tenant
MONGO_URL: ${MONGO_URL:-mongodb://mongo/mredb}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET:-access_token_secret} # Change secret in production
CIPHER_KEY: ${CIPHER_KEY:-cipher_key} # Change key in production
CIPHER_IV_KEY: ${CIPHER_IV_KEY:-cipher_iv_key} # Change key in production
PDFGENERATOR_URL: http://pdfgenerator:8300/pdfgenerator
#########################################
# Email service configuration
# needed to reset landlord password
# needed to sign tenant in
#########################################
GMAIL_EMAIL: ${GMAIL_EMAIL}
GMAIL_APP_PASSWORD: ${GMAIL_APP_PASSWORD}
#########################################
# OR
#########################################
MAILGUN_API_KEY: ${MAILGUN_API_KEY}
MAILGUN_DOMAIN: ${MAILGUN_DOMAIN}
#########################################
# OR
#########################################
SMTP_SERVER: ${SMTP_SERVER}
SMTP_PORT: ${SMTP_PORT}
SMTP_SECURE: ${SMTP_SECURE}
SMTP_USERNAME: ${SMTP_USERNAME}
SMTP_PASSWORD: ${SMTP_PASSWORD}
#########################################
EMAIL_FROM: ${EMAIL_FROM}
EMAIL_REPLY_TO: ${EMAIL_REPLY_TO}
EMAIL_BCC: ${EMAIL_BCC}
#########################################
expose:
- '8400'
networks:
- net
depends_on:
mongo:
condition: service_started
pdfgenerator:
condition: service_started
###############################################################################
# api
###############################################################################
api:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/api:${MRE_VERSION:-latest}'
volumes:
- ./backup:/usr/app/backup
environment:
NODE_ENV: production
PORT: 8200
LOGGER_LEVEL: info
MONGO_URL: ${MONGO_URL:-mongodb://mongo/mredb}
EMAILER_URL: http://emailer:8400/emailer
PDFGENERATOR_URL: http://pdfgenerator:8300/pdfgenerator
RESTORE_DB: 'false'
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET:-access_token_secret} # Change secret in production
CIPHER_KEY: ${CIPHER_KEY:-cipher_key} # Change key in production
CIPHER_IV_KEY: ${CIPHER_IV_KEY:-cipher_iv_key} # Change key in production
expose:
- '8200'
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8200/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- net
depends_on:
mongo:
condition: service_started
emailer:
condition: service_started
pdfgenerator:
condition: service_started
###############################################################################
# tenant api
###############################################################################
tenantapi:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/tenantapi:${MRE_VERSION:-latest}'
environment:
NODE_ENV: production
PORT: 8250
LOGGER_LEVEL: info
MONGO_URL: ${MONGO_URL:-mongodb://mongo/mredb}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET:-access_token_secret} # Change secret in production
expose:
- '8250'
networks:
- net
depends_on:
mongo:
condition: service_started
###############################################################################
# Landlord frontend
###############################################################################
landlord-frontend:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/landlord-frontend:${MRE_VERSION:-latest}'
environment:
BASE_PATH: /landlord
PORT: 8180
DOCKER_GATEWAY_URL: http://gateway:8080
CORS_ENABLED: 'true'
GATEWAY_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN:-localhost}:${APP_PORT}
NODE_ENV: production
SIGNUP: 'true'
expose:
- '8180'
networks:
- net
depends_on:
gateway:
condition: service_started
###############################################################################
# Tenant frontend
###############################################################################
tenant-frontend:
restart: unless-stopped
image: 'ghcr.io/sensible-analytics/rentroo/tenant-frontend:${MRE_VERSION:-latest}'
environment:
BASE_PATH: /tenant
PORT: 8190
DOCKER_GATEWAY_URL: http://gateway:8080
CORS_ENABLED: 'true'
GATEWAY_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN:-localhost}:${APP_PORT}
NODE_ENV: production
expose:
- '8190'
networks:
- net
depends_on:
gateway:
condition: service_started
###############################################################################
# microservices network
###############################################################################
networks:
net:
driver: bridge