generated from ConductionNL/Proto-component-commonground
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
236 lines (221 loc) · 6.95 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
version: '3.5'
x-cache:
&cache
cache_from:
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-php
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-nginx
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-varnish
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-admin
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-client
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-h2-proxy
services:
php:
&php
image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-php:${APP_ENV}
build:
context: ./api
target: api_platform_php
<<: *cache
depends_on:
- db
volumes:
- ./api:/srv/api:rw,cached
- ./nlx-setup:/cert:rw,cached
#- ./nlx-setup:/Users/<your-username>/nlx-setup:rw,cached
# If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
# - ./api/var:/srv/api/var:rw
environment:
- APP_ENV=${APP_ENV}
- APP_DEBUG=${APP_DEBUG}
- APP_VERSION=${CONTAINER_PROJECT_VERSION}
- APP_TITLE=${CONTAINER_PROJECT_TITLE}
- APP_NAME=${CONTAINER_PROJECT_NAME}
- NLX_OUTWAY=${NLX_OUTWAY}
- NLX_INWAY=${NLX_INWAY}
- CONTAINER_REGISTRY_BASE=${CONTAINER_REGISTRY_BASE}
- CONTAINER_PROJECT_TITLE=${CONTAINER_PROJECT_TITLE}
- CONTAINER_PROJECT_NAME=${CONTAINER_PROJECT_NAME}
- CONTAINER_PROJECT_VERSION=${CONTAINER_PROJECT_VERSION}
- DATABASE_URL=postgres://api-platform:!ChangeMe!@db/api?serverVersion=10.1
ports:
- "8082:80"
api:
image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-nginx:${APP_ENV}
build:
context: ./api
target: api_platform_nginx
<<: *cache
depends_on:
- php
# Comment out this volume in production if you do not want to use nlx
# - nlx-outway
# If you us this docker-compose file for production enviroments and want to us nlx-inway uncomment the following lins
# - nlx-inway
# Comment out this volume in production
volumes:
- ./api/public:/srv/api/public:ro
ports:
- "8080:80"
environment:
- NGINX_HOST=php
cache-proxy:
&varnish
image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-varnish:${APP_ENV}
build:
context: ./api
target: api_platform_varnish
<<: *cache
depends_on:
- api
- php
volumes:
- ./api/docker/varnish/conf:/usr/local/etc/varnish:rw,cached
tmpfs:
- /usr/local/var/varnish:exec
ports:
- "8081:80"
environment:
- PHP_SERVICE=api
nlx-outway:
image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-nlx-outway:${APP_ENV}
build:
context: ./api
target: api-nlx-outway
depends_on:
- nlx-postgres
volumes:
- ./api/nlx-setup:/certs:rw,cached
environment:
- DIRECTORY_INSPECTION_ADDRESS=directory-inspection-api.demo.nlx.io:443
- TLS_NLX_ROOT_CERT=/certs/root.crt
- TLS_ORG_CERT=/certs/org.crt
- TLS_ORG_KEY=/certs/org.key
- POSTGRES_DSN=postgres://postgres:postgres@nlx-postgres/txlog-db?sslmode=disable&connect_timeout=10
networks:
- nlx
# Uncomment the follwoign lines if you want to deploy trough a docker-compose chart and wish to use an nlx inway
#
# nlx-inway:
# image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-nlx-inway:${APP_ENV}
# build:
# context: ./api
# target: api-nlx-inway
# depends_on:
# - nlx-postgres
# volumes:
# - ./api/nlx-setup:/certs:rw,cached
# environment:
# - DIRECTORY_REGISTRATION_ADDRESS=directory-registration-api.demo.nlx.io:443
# - SELF_ADDRESS=pc.zaakonline.nl:443
# - SERVICE_CONFIG=/service-config.toml
# - TLS_NLX_ROOT_CERT=/certs/root.crt
# - TLS_ORG_CERT=/certs/org.crt
# - TLS_ORG_KEY=/certs/org.key
# - POSTGRES_DSN=postgres://postgres:postgres@nlx-postgres/txlog-db?sslmode=disable&connect_timeout=10
# networks:
# - nlx
# Comment out this service in production if you do not want to use nlx
nlx-postgres:
image: postgres:12
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: txlog-db
POSTGRES_USER: postgres
volumes:
- nlx-data-2:/var/lib/postgresql/data:rw
networks:
- nlx
# Comment out this service in production if you do not want to use nlx
txlog-db:
image: nlxio/txlog-db
depends_on:
- nlx-postgres
- nlx-outway
# If you us this docker-compose file for production enviroments and want to us nlx-inway uncomment the following lins
# - nlx-inway
environment:
PGHOST: nlx-postgres
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: txlog-db
command: /usr/local/bin/upgrade-db.sh
networks:
- nlx
db:
image: postgres:10-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_USER=api-platform
# You should definitely change the password in production
- POSTGRES_PASSWORD=!ChangeMe!
volumes:
- db-data:/var/lib/postgresql/data:rw
mercure:
# In production, you may want to use the managed version of Mercure, https://mercure.rocks
image: dunglas/mercure
environment:
# You should definitely change all these values in production
- JWT_KEY=!UnsecureChangeMe!
- ALLOW_ANONYMOUS=1
- CORS_ALLOWED_ORIGINS=*
- PUBLISH_ALLOWED_ORIGINS=http://localhost:1337,https://localhost:1338
- DEMO=1
ports:
- "1337:80"
client:
# Use a static website hosting service in production
# See https://facebook.github.io/create-react-app/docs/deployment
image: ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-client
build:
context: ./client
cache_from:
- ${CONTAINER_REGISTRY_BASE}/client
env_file:
- ./client/.env
volumes:
- ./client:/usr/src/client:rw,cached
- /usr/src/client/node_modules
admin:
# Use a static website hosting service in production
# See https://facebook.github.io/create-react-app/docs/deployment
image: ${CONTAINER_REGISTRY_BASE}/admin
build:
context: ./admin
cache_from:
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-admin
volumes:
- ./admin:/usr/src/admin:rw,cached
- /usr/src/admin/node_modules
h2-proxy:
# Don't use this proxy in prod
build:
context: ./h2-proxy
cache_from:
- ${CONTAINER_REGISTRY_BASE}/${CONTAINER_PROJECT_NAME}-h2-proxy
depends_on:
- db
- client
- admin
- api
- cache-proxy
- mercure
#- stag-pc-cache-proxy
#- dev-pc-cache-proxy
#volumes:
# - ./conf.d/:/etc/nginx/conf.d/:rw,cached
ports:
- "80:80" #http port
- "443:443" #ssl port
- "444:444"
- "8443:8443"
- "8444:8444"
- "5432:5432" #postgress port
environment:
- APP_ENV=${APP_ENV}
- APP_NAME=${CONTAINER_PROJECT_NAME}
networks:
nlx:
name: nlx
volumes:
db-data: {}
nlx-data-2: {}