-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
239 lines (224 loc) · 5.72 KB
/
Copy pathcompose.yaml
File metadata and controls
239 lines (224 loc) · 5.72 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
x-db_healthcheck: &db_healthcheck
healthcheck:
test: ["CMD", "mariadb-admin", "--socket=/run/mysqld/mysqld.sock", "-u", "root", "ping"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
services:
db:
image: mariadb:10
volumes:
- ./db/certs:/certs:ro
- ./db/db.cnf:/etc/mysql/conf.d/my.cnf:ro
ports:
- "3306"
env_file:
- path: ./local.env
required: false
<<: *db_healthcheck
app:
build: ./
volumes:
- ./app:/app
- ./auth.json:/root/.composer/auth.json
ports:
- "51140:80"
- "51143:443"
mem_limit: 200m
depends_on:
db:
condition: service_healthy
env_file:
- path: ./local.env
required: false
- ./db/certs/test.env
environment:
# RUN_TASK: cron/all
EMAILER_CLASS: \Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer
EMAIL_SIGNATURE: "Dummy Signature for Development\r\rdo not reply to this email"
appfortests:
build: ./
volumes:
- ./app:/app
- ./auth.json:/root/.composer/auth.json
mem_limit: 200m
ports:
- "80"
depends_on:
testdb:
condition: service_healthy
env_file:
- ./db/certs/test.env
- ./test.env
healthcheck:
test: curl --connect-timeout 5 http://localhost:80/site/status
start_period: 1s
interval: 1s
timeout: 5s
retries: 20
testdb:
image: mariadb:10
volumes:
- ./db/certs:/certs:ro
- ./db/testdb.cnf:/etc/mysql/conf.d/my.cnf:ro
ports:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: appfortests
MYSQL_USER: appfortests
MYSQL_PASSWORD: appfortests
<<: *db_healthcheck
cli:
image: ghcr.io/sil-org/php8:8.3
platform: linux/amd64
volumes:
- composer-cache:/composer
- ./app:/app
- ./auth.json:/root/.composer/auth.json
working_dir: /app
environment:
COMPOSER_CACHE_DIR: /composer
env_file:
- path: ./local.env
required: false
command: ["true"]
dynamo:
image: amazon/dynamodb-local
platform: linux/amd64
ports:
- "8000:8000"
environment:
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DEFAULT_REGION: us-east-1
command: "-jar DynamoDBLocal.jar -sharedDb"
mfaapi:
build: ./serverless-mfa-api
ports:
- 8080
volumes:
- ./serverless-mfa-api/override:/src/override
environment:
AWS_ENDPOINT: http://dynamo:8000
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DISABLE_SSL: "true"
API_KEY_TABLE: ApiKey
TOTP_TABLE: Totp
WEBAUTHN_TABLE: WebAuthn
depends_on:
- dynamo
- dynamorestart
working_dir: /src
# Copy files from the override folder to be used for possible troubleshooting (e.g. with extra log statements)
# (using bash -c to keep the chown command from ignoring the && and throwing an error)
command: bash -c "cp -R ./override/* ./ && go run ./server/"
healthcheck:
test: ["CMD", "curl", "localhost:8080/status"]
start_period: 1s
interval: 1s
timeout: 2s
retries: 3
u2fsim:
build: ./u2f-simulator
ports:
- 8080
volumes:
- ./u2f-simulator/override:/src/override
working_dir: /src
# Copy files from the override folder to be used for possible troubleshooting (e.g. with extra log statements)
command: bash -c "cp -R ./override/* ./ && go run ./u2fserver/"
dynamorestart:
build: ./dynamorestart
ports:
- 8080
volumes:
- ./dynamorestart/:/dynamo
environment:
AWS_ENDPOINT: dynamo:8000
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DISABLE_SSL: "true"
API_KEY_TABLE: ApiKey
WEBAUTHN_TABLE: WebAuthn
depends_on:
- dynamo
working_dir: /dynamo
command: bash -c "pwd && ls -al && php restart.php"
mail-admin:
image: mockoon/cli:9
command: ["--data", "data", "--port", "80"]
volumes:
- ./app/features/mocks/account-mail-admins.json:/data:readonly
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80/account-mail-admins || exit 1"]
interval: 5s
timeout: 3s
retries: 5
start_period: 2s
test:
image: ghcr.io/sil-org/php8:8.3
platform: linux/amd64
volumes:
- ./app:/app
- ./auth.json:/root/.composer/auth.json
mem_limit: 200m
working_dir: /app
depends_on:
mail-admin:
condition: service_healthy
appfortests:
condition: service_healthy
mfaapi:
condition: service_healthy
u2fsim:
condition: service_started
env_file:
- ./db/certs/test.env
- ./test.env
command: ./run-tests.sh
# running isolated tests
# docker compose run --rm test vendor/bin/behat --stop-on-failure features/user.feature
# docker compose run --rm test vendor/bin/behat --stop-on-failure features/user.feature:306
phpmyadmin:
image: phpmyadmin:5
ports:
- "51141:80"
depends_on:
- db
env_file:
- path: ./local.env
required: false
environment:
PMA_HOST: db
PMA_USER: user
PMA_PASSWORD: pass
PMA_SSL: 1
phpmyadmintest:
image: phpmyadmin:5
ports:
- "51142:80"
depends_on:
- testdb
env_file:
- path: ./local.env
required: false
environment:
PMA_HOST: testdb
PMA_USER: appfortests
PMA_PASSWORD: appfortests
PMA_SSL: 1
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.20.39.0/24
gateway: 10.20.39.1
volumes:
composer-cache: