-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.e2e.yml
242 lines (233 loc) · 7.3 KB
/
docker-compose.e2e.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
services:
proxy:
image: traefik:v2.5
container_name: traefik
ports:
- 80:80
- 443:443
- 8080:8080
command:
- '--log.level=DEBUG'
- '--api.insecure=true'
- '--providers.docker=true'
- '--providers.docker.exposedbydefault=false'
- '--providers.file.directory=/etc/traefik/dynamic'
- '--entrypoints.websecure.address=:443'
- '--entrypoints.web.address=:80'
- '--providers.docker.network=pdce2e_back'
# - '--entrypoints.web.http.redirections.entryPoint.to=websecure'
# - '--entrypoints.web.http.redirections.entryPoint.scheme=https'
# - '--entrypoints.web.http.redirections.entryPoint.permanent=true'
volumes:
- ./docker/traefik/config.yml:/etc/traefik/dynamic/config.yml
- ./docker/traefik/certs:/etc/certs
- '/var/run/docker.sock:/var/run/docker.sock:ro'
networks:
back:
front:
aliases:
- auth.covoiturage.test
- api.covoiturage.test
- app.covoiturage.test
- mailer.covoiturage.test
- s3.covoiturage.test
- download.covoiturage.test
- local-pdc-export.s3.covoiturage.test
kc:
image: keycloak/keycloak:24.0
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_DB: postgres
KC_DB_USERNAME: postgres
KC_DB_PASSWORD: postgres
KC_DB_URL: "jdbc:postgresql://postgres:5432/test"
KC_REALM_NAME: covoiturage
PDC_URL: http://app.covoiturage.test
PDC_ADMIN_USERNAME: admin
PDC_ADMIN_PASSWORD: admin
PDC_KC_ADMIN_CLIENT_SECRET: so_secret_000
PDC_KC_BOT_CLIENT_SECRET: so_secret_000
PDC_KC_CLIENT_SECRET: so_secret_000
networks:
- back
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.kc-http.rule=Host(`auth.covoiturage.test`)'
- 'traefik.http.routers.kc-http.entrypoints=web'
- 'traefik.http.routers.kc-https.rule=Host(`auth.covoiturage.test`)'
- 'traefik.http.routers.kc-https.entrypoints=websecure'
- 'traefik.http.routers.kc-https.tls=true'
- 'traefik.http.services.kc.loadbalancer.server.port=8080'
command: ["start-dev", "--import-realm"]
volumes:
- ./docker/keycloak/realm.json:/opt/keycloak/data/import/realm.json:ro
mailer:
image: mailhog/mailhog:v1.0.1
environment:
MH_CORS_ORIGIN: '*'
ports:
- 1025:1025
networks:
- back
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.mailer.rule=Host(`mailer.covoiturage.test`)'
- 'traefik.http.routers.mailer.entrypoints=websecure'
- 'traefik.http.routers.mailer.tls=true'
- 'traefik.http.services.mailer.loadbalancer.server.port=8025'
postgres:
build: ./docker/postgres
ports:
- 5432:5432
networks:
- back
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'postgres'
POSTGRES_DB: 'test'
redis:
build: './docker/redis'
ports:
- 6379:6379
networks:
- back
wait:
image: busybox:1.33
environment:
DOMAIN: api
PORT: 8080
networks:
- back
command: ['/bin/sh', '-c', 'until nc -zv $$DOMAIN $$PORT -w1; do echo "waiting for app"; sleep 1; done']
dashboard:
volumes:
- ./docker/dashboard/ci.env.js:/usr/share/nginx/html/assets/env.js:ro
build:
dockerfile: ./docker/dashboard/prod/Dockerfile
context: .
networks:
- back
depends_on:
- api
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.dashboard.rule=Host(`app.covoiturage.test`)'
- 'traefik.http.routers.dashboard.entrypoints=websecure'
- 'traefik.http.routers.dashboard.tls=true'
- 'traefik.http.services.dashboard.loadbalancer.server.port=8080'
api:
build:
dockerfile: ./docker/api/Dockerfile
context: .
environment:
LOG_LEVEL: DEBUG
APP_APP_URL: https://app.covoiturage.test
APP_JWT_SECRET: thisIsASecret0000
APP_SESSION_SECRET: thisIsAlsoASecret0000
AWS_S3_PATH_STYLE: 'true'
AWS_BUCKET_PREFIX: local-pdc
AWS_ENDPOINT: http://minioadmin:minioadmin@s3:9000
AWS_REGION: fr-par
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
APP_POSTGRES_URL: postgres://postgres:postgres@postgres:5432/test
APP_REDIS_URL: redis://redis:6379/1
APP_MAIL_SMTP_URL: smtp://mailer:1025
APP_RATE_LIMIT_MAX_FACTOR: '0'
APP_DATAGOUV_URL: http://data-gouv-url
APP_DATAGOUV_KEY: thisIsASecret
APP_CEE_PUBLIC_KEY_PATH: /app/certs/publicKey.pem
APP_CEE_PRIVATE_KEY_PATH: /app/certs/privateKey.pem
PORT: 8080
NODE_ENV: local
APP_ENV: local
APP_INSEE_API_KEY: ${APP_INSEE_API_KEY}
APP_USER_REGISTRATION_ENABLED: 'true'
networks:
- back
- front
depends_on:
- redis
- postgres
- mailer
- s3
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api.rule=Host(`api.covoiturage.test`)'
- 'traefik.http.routers.api.entrypoints=websecure'
- 'traefik.http.routers.api.tls=true'
- 'traefik.http.services.api.loadbalancer.server.port=8080'
volumes:
- ./docker/api/certs:/app/certs:ro
cms:
build:
dockerfile: ../docker/cms/prod/Dockerfile
context: ./cms
environment:
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_NAME: test
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
APP_KEYS: REPLACE_ME
API_TOKEN_SALT: REPLACE_ME
JWT_SECRET: REPLACE_ME
ADMIN_JWT_SECRET: REPLACE_ME
TRANSFER_TOKEN_SALT: REPLACE_ME
NODE_ENV: production
EMAIL_SMTP_URL: smtp://mailer:1025
EMAIL_ADDRESS_FROM: [email protected]
EMAIL_ADDRESS_REPLY: [email protected]
S3_ACCESS_KEY_ID: minioadmin
S3_ACCESS_SECRET: minioadmin
S3_ENDPOINT: http://s3:9000
S3_REGION: fr-par
S3_BUCKET: cms
S3_PUBLIC_URL: https://cms.s3.covoiturage.test
TRUSTED_ROOT_DOMAIN: covoiturage.test
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api.rule=Host(`cms.covoiturage.test`)'
- 'traefik.http.routers.api.entrypoints=websecure'
- 'traefik.http.routers.api.tls=true'
- 'traefik.http.services.api.loadbalancer.server.port=1337'
networks:
- back
- front
depends_on:
- redis
- postgres
- mailer
- s3
s3:
image: minio/minio:edge
networks:
- back
command: 'server /data'
ports:
- "9000:9000"
environment:
MINIO_DOMAIN: s3.covoiturage.test
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.s3.rule=Host(`s3.covoiturage.test`, `local-pdc-export.s3.covoiturage.test`, `download.covoiturage.test`, `cms.s3.covoiturage.test`)'
- 'traefik.http.routers.s3.entrypoints=websecure'
- 'traefik.http.routers.s3.tls=true'
- 'traefik.http.services.s3.loadbalancer.server.port=9000'
s3-init:
image: minio/mc:edge
networks:
- back
environment:
MINIO_URL: http://s3:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO_REGION_NAME: fr-par
entrypoint:
['sh', '-c', 'mc alias set minio $$MINIO_URL $$MINIO_ACCESS_KEY $$MINIO_SECRET_KEY && mc mb minio/$$BUCKET']
depends_on:
- s3
networks:
front:
back: