-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.staging_new.yml
235 lines (224 loc) · 5.95 KB
/
docker-compose.staging_new.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
version: "3.6"
services:
docker-socket-proxy-ro:
deploy:
replicas: 1
image: tecnativa/docker-socket-proxy
networks:
- private-docker-socks-proxy-ro
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- EVENTS=1
- PING=1
- VERSION=1
- CONTAINERS=1
- INFO=1
- POST=0
- BUILD=0
- COMMIT=0
- CONFIGS=0
- DISTRIBUTION=0
- EXEC=0
- IMAGES=0
- NETWORKS=0
- NODES=0
- PLUGINS=0
- SERVICES=0
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=0
- VOLUMES=0
- AUTH=0
- SECRETS=0
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
docker-socket-proxy-rw:
deploy:
replicas: 1
image: tecnativa/docker-socket-proxy
networks:
- private-docker-socks-proxy-rw
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- EVENTS=1
- PING=1
- VERSION=1
- CONTAINERS=1
- INFO=1
- POST=1 #TODO: Due tue the letsencrypt container, we have to set write permissions (reloading the nginx settings). On the long run, we need another solution likehttps://github.com/adferrand/docker-letsencrypt-dns. Or kubernetes!
- BUILD=0
- COMMIT=0
- CONFIGS=0
- DISTRIBUTION=0
- EXEC=1
- IMAGES=0
- NETWORKS=0
- NODES=0
- PLUGINS=0
- SERVICES=0
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=0
- VOLUMES=0
- AUTH=0
- SECRETS=0
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
nginx-proxy:
deploy:
replicas: 1
image: jwilder/nginx-proxy:alpine
environment:
- DOCKER_HOST=tcp://docker-socket-proxy-ro:2375
- DHPARAM_GENERATION=false #We have to set this recording to: https://github.com/jwilder/nginx-proxy.
volumes:
- nginx-certs:/etc/nginx/certs #read only?
- nginx-vhosts:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- ./s_frontend/s_web/s_f_reverse_proxy/nginx/custom_nginx.conf:/etc/nginx/conf.d/custom_nginx.conf:ro
ports:
- "80:80"
- "443:443"
networks:
- private-docker-socks-proxy-ro
- web
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen."
depends_on:
- docker-socket-proxy-ro
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
#TODO: Due to the capabilities of ACME v2(wildcard support), we should consider switching to: https://github.com/adferrand/docker-letsencrypt-dns
#However, only certain DNS server provider are supported at this moment.
letsencrypt:
deploy:
replicas: 1
image: jrcs/letsencrypt-nginx-proxy-companion
environment:
- DOCKER_HOST=tcp://docker-socket-proxy-rw:2375
volumes:
- nginx-certs:/etc/nginx/certs
- nginx-vhosts:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
networks:
- private-docker-socks-proxy-rw
depends_on:
- nginx-proxy
- docker-socket-proxy-rw
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
database:
deploy:
replicas: 1
image: mongo
command: mongod --wiredTigerCacheSizeGB 0.25 #see: https://docs.mongodb.com/manual/reference/program/mongod/#wiredtiger-options
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet 1
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
volumes:
- database:/data/db
networks:
- database
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: changeme
backend_core:
deploy:
replicas: 1
image: registry.gitlab.com/wavect/backend/backend_core:latest
networks:
- web
- database
build:
dockerfile: ./Dockerfile
context: ./s_backend/s_b_core/
depends_on:
- database
environment:
VIRTUAL_HOST: api.${AC_HOSTNAME:-dev.wavect.io}
LETSENCRYPT_HOST: api.${AC_HOSTNAME:-dev.wavect.io}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-kevin.riedl.privat@gmail.com}
DATABASE_NAME: wavect
DATABASE_URI: mongodb://database:27017
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
#restart: on-failure
website_react:
deploy:
replicas: 1
image: registry.gitlab.com/wavect/frontend/react_website:latest
networks:
- web
build:
dockerfile: ./Dockerfile
context: ./s_frontend/s_web/s_f_website_paperkit
depends_on:
- backend_core
environment:
VIRTUAL_HOST: wavect.io,www.wavect.io
LETSENCRYPT_HOST: wavect.io,www.wavect.io
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-kevin.riedl.privat@gmail.com}
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
restart: always
# #Don't delete me! Instead, redirect wavect.io to coming-soon if the wp instance is down...
# coming-soon-page:
# deploy:
# replicas: 1
# image: registry.gitlab.com/wavect/coming-soon-page/coming-soon-page:latest
# networks:
# - web
# build:
# dockerfile: ./Dockerfile
# context: ./s_frontend/s_web/s_f_comingsoon
# environment:
# VIRTUAL_HOST: coming-soon.dev.wavect.io
# LETSENCRYPT_HOST: coming-soon.dev.wavect.io
# LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-kevin.riedl.privat@gmail.com}
networks:
private-docker-socks-proxy-ro:
private-docker-socks-proxy-rw:
web:
database:
volumes:
database:
nginx-certs:
nginx-vhosts:
nginx-html: