-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
144 lines (136 loc) · 4.38 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
services:
govwifi-sessions-db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: testpassword
MYSQL_DATABASE: govwifi_local
volumes:
- ./init_sessions_db:/docker-entrypoint-initdb.d
healthcheck:
test: "mysql --user=root --password=testpassword -e 'SELECT 1'"
govwifi-user-details-db:
image: mysql:8.0
command: "--default-authentication-plugin=mysql_native_password"
environment:
MYSQL_ROOT_PASSWORD: testpassword
MYSQL_DATABASE: govwifi_local
volumes:
- ./init_user_details_db:/docker-entrypoint-initdb.d
healthcheck:
test: "mysql --user=root --password=testpassword -e 'SELECT 1'"
govwifi-fake-s3:
image: localstack/localstack
ports:
- "4566:4566"
environment:
- SERVICES=s3
- DOCKER_HOST=unix:///var/run/docker.sock
- DEFAULT_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=testkey
- AWS_SECRET_ACCESS_KEY=testsecret
healthcheck:
test: "[ $$(AWS_ACCESS_KEY_ID=fake AWS_SECRET_ACCESS_KEY=fake aws --endpoint-url=http://localhost:4566 s3 ls certs-bucket | wc -l) -gt 2 ]"
volumes:
- ./fake-s3:/var/lib/localstack
- ./fake-s3/localstack-init:/etc/localstack/init/ready.d
govwifi-frontend-local:
build:
context: .frontend
depends_on:
- govwifi-logging-api-local
- govwifi-authentication-api-local
healthcheck:
test: "[ $$(curl --write-out '%{http_code}' --silent --output /dev/null 127.0.0.1:3000) -eq 200 ]"
interval: 10s
retries: 30
environment:
APP_ENV: production
AUTHORISATION_API_BASE_URL: "http://govwifi-authentication-api-local:8080"
LOGGING_API_BASE_URL: "http://govwifi-logging-api-local:8080"
RADIUS_CONFIG_ALLOWLIST_URL: "http://govwifi-fake-s3:4566/clients.conf"
HEALTH_CHECK_RADIUS_KEY: RrPTmh8s9NZFenAFx2kG
HEALTH_CHECK_SSID: GovWifi
HEALTH_CHECK_IDENTITY: DSLPR
HEALTH_CHECK_PASSWORD: SharpRegainDetailed
RADIUSD_PARAMS: "-X"
volumes:
- raddb-certs:/etc/raddb/certs
govwifi-frontend-raddb-local:
build:
context: .frontend
dockerfile: Dockerfile.raddb
depends_on:
govwifi-fake-s3:
condition: service_healthy
environment:
AWS_DEFAULT_REGION: eu-west-1
AWS_ACCESS_KEY_ID: testkey
AWS_SECRET_ACCESS_KEY: testsecret
ALLOWLIST_BUCKET: s3://allowlist-bucket
CERT_STORE_BUCKET: s3://certs-bucket
TRUSTED_CERTIFICATES_KEY: trusted-certificates/certificates.zip
ENDPOINT_URL: "http://govwifi-fake-s3:4566"
volumes:
- raddb-certs:/etc/raddb/certs
govwifi-authentication-api-local:
build:
context: .authentication-api
args:
BUNDLE_INSTALL_CMD: bundle install --without test --no-cache --jobs 8
environment:
APP_ENV: production
DB_HOSTNAME: govwifi-user-details-db
DB_USER: root
DB_PASS: testpassword
DB_NAME: govwifi_local
depends_on:
govwifi-sessions-db:
condition: service_healthy
govwifi-user-details-db:
condition: service_healthy
govwifi-logging-api-local:
ports:
- "8080:8080"
build:
context: .logging-api
args:
BUNDLE_INSTALL_CMD: bundle install --without test, vscodedev --no-cache --jobs 1 --retry 5
environment:
APP_ENV: production
DB_HOSTNAME: govwifi-sessions-db
DB_USER: root
DB_PASS: testpassword
DB_NAME: govwifi_local
USER_DB_NAME: govwifi_local
USER_DB_PASS: testpassword
USER_DB_USER: root
USER_DB_HOSTNAME: govwifi-user-details-db
depends_on:
govwifi-sessions-db:
condition: service_healthy
govwifi-user-details-db:
condition: service_healthy
govwifi-test:
build:
context: acceptance_tests
depends_on:
govwifi-frontend-local:
condition: service_healthy
environment:
DB_HOSTNAME: govwifi-sessions-db
DB_NAME: govwifi_local
DB_USER: root
DB_PASS: testpassword
USER_DB_NAME: govwifi_local
USER_DB_PASS: testpassword
USER_DB_USER: root
USER_DB_HOSTNAME: govwifi-user-details-db
FRONTEND_CONTAINER: govwifi-frontend-local
RADIUS_KEY: testingradiussecret
AWS_DEFAULT_REGION: eu-west-1
AWS_ACCESS_KEY_ID: testkey
AWS_SECRET_ACCESS_KEY: testsecret
CERT_STORE_BUCKET: s3://certs-bucket
ENDPOINT_URL: "http://govwifi-fake-s3:4566"
volumes:
raddb-certs: