Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
305 lines (292 loc) · 8.85 KB
/
Copy pathdocker-compose.yml
File metadata and controls
305 lines (292 loc) · 8.85 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
302
303
304
305
# Licensed under the Apache License, Version 2.0 (the “License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an “AS IS” BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Tested with: Docker desktop in windows.
# Launch using docker compose: docker-compose -f docker-compose.yml --compatibility up -d
# Known issues: The build for damn vulnerable web application fails on some Linux distro's (Still unclear exactly which at this this)
services:
crapi-identity:
container_name: crapi-identity
image: crapi/crapi-identity@sha256:41649ff5dad09e3456c7e1153a0644f92f9cae85caffaa3ab997200c86c89df3
#ports:
# - "${LISTEN_IP:-127.0.0.1}:8080:8080"
volumes:
- ./keys:/keys
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- DB_NAME=crapi
- DB_USER=admin
- DB_PASSWORD=crapisecretpassword
- DB_HOST=postgresdb
- DB_PORT=5432
- SERVER_PORT=${IDENTITY_SERVER_PORT:-8080}
- ENABLE_SHELL_INJECTION=${ENABLE_SHELL_INJECTION:-false}
- JWT_SECRET=crapi
- MAILHOG_HOST=mailhog
- MAILHOG_PORT=1025
- MAILHOG_DOMAIN=example.com
- SMTP_HOST=smtp.example.com
- SMTP_PORT=587
- SMTP_EMAIL=user@example.com
- SMTP_PASS=xxxxxxxxxxxxxx
- SMTP_FROM=no-reply@example.com
- SMTP_AUTH=true
- SMTP_STARTTLS=true
- JWT_EXPIRATION=604800000
- ENABLE_LOG4J=${ENABLE_LOG4J:-false}
- API_GATEWAY_URL=https://api.mypremiumdealership.com
- TLS_ENABLED=${TLS_ENABLED:-false}
- TLS_KEYSTORE_TYPE=PKCS12
- TLS_KEYSTORE=classpath:certs/server.p12
- TLS_KEYSTORE_PASSWORD=passw0rd
- TLS_KEY_PASSWORD=passw0rd
- TLS_KEY_ALIAS=identity
depends_on:
postgresdb:
condition: service_healthy
mongodb:
condition: service_healthy
mailhog:
condition: service_healthy
healthcheck:
test: /app/health.sh
interval: 15s
timeout: 15s
retries: 15
deploy:
resources:
limits:
cpus: '0.8'
memory: 384M
crapi-community:
container_name: crapi-community
image: crapi/crapi-community@sha256:f9ce203fa9c93e70fb2ae4a1595786bb51219edfe9c01dd4e648df3a6da5d38b
#ports:
# - "${LISTEN_IP:-127.0.0.1}:8087:8087"
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080}
- DB_NAME=crapi
- DB_USER=admin
- DB_PASSWORD=crapisecretpassword
- DB_HOST=postgresdb
- DB_PORT=5432
- SERVER_PORT=${COMMUNITY_SERVER_PORT:-8087}
- MONGO_DB_HOST=mongodb
- MONGO_DB_PORT=27017
- MONGO_DB_USER=admin
- MONGO_DB_PASSWORD=crapisecretpassword
- MONGO_DB_NAME=crapi
- TLS_ENABLED=${TLS_ENABLED:-false}
- TLS_CERTIFICATE=certs/server.crt
- TLS_KEY=certs/server.key
depends_on:
postgresdb:
condition: service_healthy
mongodb:
condition: service_healthy
crapi-identity:
condition: service_healthy
healthcheck:
test: /app/health.sh
interval: 15s
timeout: 15s
retries: 15
deploy:
resources:
limits:
cpus: '0.3'
memory: 192M
crapi-workshop:
container_name: crapi-workshop
image: crapi/crapi-workshop@sha256:171a3b6dc979a864aa39f34debea9846de3b85e127374798082b43939a22948d
#ports:
# - "${LISTEN_IP:-127.0.0.1}:8000:8000"
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080}
- DB_NAME=crapi
- DB_USER=admin
- DB_PASSWORD=crapisecretpassword
- DB_HOST=postgresdb
- DB_PORT=5432
- SERVER_PORT=${WORKSHOP_SERVER_PORT:-8000}
- MONGO_DB_HOST=mongodb
- MONGO_DB_PORT=27017
- MONGO_DB_USER=admin
- MONGO_DB_PASSWORD=crapisecretpassword
- MONGO_DB_NAME=crapi
- SECRET_KEY=crapi
- API_GATEWAY_URL=https://api.mypremiumdealership.com
- TLS_ENABLED=${TLS_ENABLED:-false}
- TLS_CERTIFICATE=certs/server.crt
- TLS_KEY=certs/server.key
depends_on:
postgresdb:
condition: service_healthy
mongodb:
condition: service_healthy
crapi-identity:
condition: service_healthy
crapi-community:
condition: service_healthy
healthcheck:
test: /app/health.sh
interval: 15s
timeout: 15s
retries: 15
deploy:
resources:
limits:
cpus: '0.3'
memory: 128M
crapi-web:
container_name: crapi-web
image: crapi/crapi-web@sha256:03d0758b8af1d0d70d5152b81ea373d91c14bcc1a9b92fa0ae935dad3a1db264
ports:
- "${LISTEN_IP:-127.0.0.1}:8888:80"
- "${LISTEN_IP:-127.0.0.1}:8443:443"
environment:
- COMMUNITY_SERVICE=crapi-community:${COMMUNITY_SERVER_PORT:-8087}
- IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080}
- WORKSHOP_SERVICE=crapi-workshop:${WORKSHOP_SERVER_PORT:-8000}
- MAILHOG_WEB_SERVICE=mailhog:8025
- TLS_ENABLED=${TLS_ENABLED:-false}
depends_on:
crapi-community:
condition: service_healthy
crapi-identity:
condition: service_healthy
crapi-workshop:
condition: service_healthy
healthcheck:
test: curl 0.0.0.0:80/health
interval: 15s
timeout: 15s
retries: 15
deploy:
resources:
limits:
cpus: '0.3'
memory: 128M
postgresdb:
container_name: postgresdb
image: postgres@sha256:e84397672fce21223933cd4f9b09fdea0c1c72daa834c57a613121c927b2ba61
command: ["postgres", "-c", "max_connections=500"]
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: crapisecretpassword
POSTGRES_DB: crapi
#ports:
# - "${LISTEN_IP:-127.0.0.1}:5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 15s
timeout: 15s
retries: 15
volumes:
- postgresql-data:/var/lib/postgresql/data/
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
mongodb:
container_name: mongodb
image: mongo@sha256:52c42cbab240b3c5b1748582cc13ef46d521ddacae002bbbda645cebed270ec0
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: crapisecretpassword
#ports:
# - "${LISTEN_IP:-127.0.0.1}:27017:27017"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongodb:27017/test --quiet
interval: 15s
timeout: 15s
retries: 15
start_period: 20s
volumes:
- mongodb-data:/data/db
deploy:
resources:
limits:
cpus: '0.3'
memory: 128M
mailhog:
user: root
container_name: mailhog
image: crapi/mailhog@sha256:4ba715d421f77fd6e2b511fdbcba78234d6232cde453021f2ed4b368fae32960
environment:
MH_MONGO_URI: admin:crapisecretpassword@mongodb:27017
MH_STORAGE: mongodb
ports:
# - "127.0.0.1:1025:1025" # smtp server
- "${LISTEN_IP:-127.0.0.1}:8025:8025" # Mail ui
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "8025" ]
interval: 15s
timeout: 15s
retries: 15
deploy:
resources:
limits:
cpus: '0.3'
memory: 128M
api.mypremiumdealership.com:
container_name: api.mypremiumdealership.com
image: crapi/gateway-service@sha256:becb3201cfc95592896bb35a4a1b6f1d656ce2cf212fe2872ff947f7ff12c3f4
#ports:
# - "${LISTEN_IP:-127.0.0.1}:8443:443" # https
healthcheck:
test: echo -n "GET / HTTP/1.1\n\n" > /dev/tcp/127.0.0.1/443
interval: 15s
timeout: 15s
retries: 15
start_period: 15s
deploy:
resources:
limits:
cpus: '0.1'
memory: 50M
juiceshop:
image: bkimminich/juice-shop@sha256:c6f965f8929c2c43676e3ac55cd19d482c0084400195db07ed7513a04f3468b5
ports:
- "3000:3000"
dvwa:
# switched from local build to the published image pinned by digest
image: ghcr.io/digininja/dvwa@sha256:68159f0a6acc47800127e22798fd547201c915cb15c7f9a5ea12419532e4aa30
environment:
- DB_SERVER=db
depends_on:
- db
networks:
- dvwa
ports:
- 4280:80
restart: unless-stopped
db:
image: mariadb@sha256:e4ad7c5ad8874c2b049cef7566ccf534856b9fcde1c3c89c3251e8fa6fd6915c
environment:
- MYSQL_ROOT_PASSWORD=dvwa
- MYSQL_DATABASE=dvwa
- MYSQL_USER=dvwa
- MYSQL_PASSWORD=p@ssw0rd
volumes:
- dvwa:/var/lib/mysql
networks:
- dvwa
restart: unless-stopped
volumes:
mongodb-data:
postgresql-data:
dvwa:
networks:
dvwa: