forked from TheSoftwareHouse/rad-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
275 lines (253 loc) · 7.56 KB
/
docker-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
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
version: '3.4'
services:
security:
image: security-service:latest
working_dir: /app/build/services/security
command: [sh, -c, 'node-dev ./src/index.js']
hostname: security
environment:
API_URL: "https://api.lvh.me"
OAUTH_ENABLED_PROVIDERS: "google,facebook,microsoft"
OAUTH_CREATE_USER_ACCOUNT: "true"
OAUTH_GOOGLE_CLIENT_ID: 1024671591387-1h85kq8p747i478ouqinaq5tm5953u17.apps.googleusercontent.com
OAUTH_GOOGLE_CLIENT_SECRET: GMHPdnGTRGLmelReTFHxNBfU
OAUTH_GOOGLE_CLIENT_ALLOWED_DOMAINS: tsh.io,thesoftwarehouse.pl
OAUTH_FACEBOOK_CLIENT_ID: 959016991183154
OAUTH_FACEBOOK_CLIENT_SECRET: b184620eea19a283573c38b614e9dec5
OAUTH_MICROSOFT_CLIENT_ID: "e84c2905-9507-44ee-9263-6392a2d885a5"
OAUTH_MICROSOFT_CLIENT_SECRET: "i@U3r/CaLj/3SskLlIo81Wy?XmwdTvtD"
OAUTH_DEFAULT_ATTRIBUTES: OAUTH_USER
ACCESS_TOKEN_EXPIRATION: 10000
REFRESH_TOKEN_SECRET: 15000
INITIAL_API_KEYS: 85f8a0f4-ef2d-43a4-b332-b89ee3c54ac3s
# MAILER_TYPE: standalone
# MAILER_SMTP_HOST: "mailhog"
# MAILER_SMTP_PORT: 1025
# MAILER_SMTP_SECURE: "false"
volumes:
- build:/app/build
depends_on:
- postgres
- redis
- mailhog
networks:
app:
aliases:
- security
scheduler:
image: scheduler-service:latest
working_dir: /app/build/services/scheduler
command: [sh, -c, 'node-dev ./src/index.js']
hostname: scheduler
volumes:
- build:/app/build
depends_on:
- postgres
- redis
networks:
- app
mailer:
image: mailer-service:latest
working_dir: /app/build/services/mailer
command: [sh, -c, 'node-dev ./src/index.js']
hostname: mailer
depends_on:
- redis
- mailhog
environment:
TRANSPORT_SMTP_HOST: mailhog
TRANSPORT_SMTP_PORT: 1025
TRANSPORT_SMTP_SECURE: "false"
volumes:
- build:/app/build
networks:
- app
notifications:
image: notifications-service:latest
working_dir: /app/build/services/notifications
command: [sh, -c, 'node-dev ./src/index.js']
hostname: notifications
depends_on:
- postgres
volumes:
- build:/app/build
networks:
- app
pdf:
image: pdf-service:latest
working_dir: /app/build/services/pdf
command: [sh, -c, 'node-dev ./src/index.js']
hostname: pdf
volumes:
- build:/app/build
networks:
app:
aliases:
- pdf
postgres:
image: postgres:12-alpine
volumes:
- ./postgresql-multiple-databases:/docker-entrypoint-initdb.d
environment:
POSTGRES_PASSWORD: password
POSTGRES_USERNAME: postgres
POSTGRES_MULTIPLE_DATABASES: users,scheduler,notifications
networks:
- app
redis:
image: redis:4-alpine
hostname: redis
networks:
- app
gateway:
image: gateway-service:latest
working_dir: /app/build/services/gateway
command: [sh, -c, 'node-dev ./src/index.js']
hostname: gateway
environment:
PROXY_CONFIG_PATH: "/app/services/gateway/src/config/proxy.json"
API_URL: "http://localhost:50050"
depends_on:
- security
volumes:
- build:/app/build
networks:
- app
security-integration-tests:
image: security-service-prod:latest
working_dir: /app/build/services/security
command: [sh, -c, "npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/{,!(authorization-strategies)/**}/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --timeout 10000 --exit && sleep 20 && AUTHENTICATION_STRATEGY=keycloak node ./node_modules/.bin/mocha \"src/integration-tests/authorization-strategies/keycloak-authentication-client.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit", ]
environment:
OAUTH_ENABLED_PROVIDERS: "google,facebook"
OAUTH_CREATE_USER_ACCOUNT: "true"
DB_LOGGING: "false"
depends_on:
- redis
- postgres
- mailhog
- keycloak
networks:
- app
mailer-integration-tests:
image: mailer-service-prod:latest
working_dir: /app/build/services/mailer
command: [sh, -c, 'npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/**/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit']
environment:
DB_LOGGING: "false"
depends_on:
- redis
networks:
- app
notifications-integration-tests:
image: notifications-service-prod:latest
working_dir: /app/build/services/notifications
command: [sh, -c, 'npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/**/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit']
environment:
DB_LOGGING: "false"
depends_on:
- postgres
networks:
- app
gateway-integration-tests:
image: gateway-service-prod:latest
working_dir: /app/build/services/gateway
command: [sh, -c, 'npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/**/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit']
hostname: gateway
environment:
API_URL: "http://security-prod:50050"
DB_LOGGING: "false"
depends_on:
- security-prod
networks:
- app
pdf-integration-tests:
image: pdf-service-prod:latest
working_dir: /app/build/services/pdf
command: [sh, -c, 'npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/**/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit']
hostname: pdf
environment:
API_URL: "http://pdf:50050"
DB_LOGGING: "false"
networks:
app:
aliases:
- pdf
scheduler-integration-tests:
image: scheduler-service-prod:latest
working_dir: /app/build/services/scheduler
command: [sh, -c, 'npm i mocha && node ./node_modules/.bin/mocha \"src/integration-tests/**/*.spec.js\" --file=\"src/integration-tests/bootstrap.js\" --exit']
environment:
DB_LOGGING: "false"
depends_on:
- redis
- postgres
networks:
- app
keycloak:
image: jboss/keycloak
command: ["-Djboss.socket.binding.port-offset=10"]
environment:
DB_VENDOR: POSTGRES
DB_ADDR: keycloak-postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: "admin"
KEYCLOAK_PASSWORD: "admin"
ports:
- 8090:8090
networks:
- app
depends_on:
- keycloak-postgres
keycloak-postgres:
image: postgres:12-alpine
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
volumes:
- ./keycloak/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
- ./keycloak/keycloak-postgres-data.sql:/keycloak-postgres-data.sql
networks:
- app
js:
image: app:latest
networks:
- app
builder:
image: app:latest
container_name: builder
command: [sh, -c, 'rm -rf ./build/* && ./node_modules/.bin/tsc -w --pretty --skipLibCheck']
volumes:
- .:/app:delegated
- build:/app/build
mailhog:
image: mailhog/mailhog
restart: always
hostname: mailhog
networks:
- app
ports:
- 1025:1025
- 8025:8025
environment:
- MH_HOSTNAME=mailhog
security-prod:
image: security-service-prod
working_dir: /app/build/services/security
command: [sh, -c, 'NODE_ENV=production node /app/build/services/security/src/index.js']
hostname: security
depends_on:
- postgres
- redis
- mailhog
networks:
app:
aliases:
- security
networks:
app:
volumes:
build: