-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.skeleton.yml
348 lines (332 loc) · 14 KB
/
docker-compose.skeleton.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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
version: '3.2'
services:
#-------------------------------------------
# BASE
#-------------------------------------------
base:
image: zeroc0d3lab/centos-base
volumes:
- /etc/localtime:/etc/localtime:ro
#environment:
#- CONTAINER_HOST= # container host (defaut: hostname of the container)
#- CONTAINER_RESOLVER=route # IP resolver method for container (disable/route/interface, default: route)
#- CONTAINER_RESOLVER_INTERFACENAME=eth0 # network interface name for IP resolver (default: eth0)
#- CONTAINER_RESOLVER_INTERFACETYPE=inet # network interface type for IP resolver (inet/inet6, default: inet)
#-------------------------------------------
# BASE-CONSUL
#-------------------------------------------
base-consul:
image: zeroc0d3lab/centos-base-consul
ports:
- "1234:1234"
volumes:
- /etc/localtime:/etc/localtime:ro
environment:
- CONSUL_AGENT=172.16.0.1 # agent hostname
- CONSUL_PORT=8500 # agent port
- CONSUL_TLS=0 # enable TLS
- CONSUL_BASE_SERVICENAME=${CONSUL_BASE_SERVICENAME} # service name to register
- CONSUL_BASE_SERVICEPORT=2220 # service port
networks:
- backend
#-------------------------------------------
# CONSUL
#-------------------------------------------
consul:
image: zeroc0d3lab/centos-consul
ports:
- "${CONSUL_PORT}:8500"
volumes:
- /etc/localtime:/etc/localtime:ro
environment:
- CONSUL_VERSION=${CONSUL_VERSION}
- CONSULTEMPLATE_VERSION=${CONSULTEMPLATE_VERSION}
- CONSUL_OPTIONS=-server -bootstrap-expect 1 -client 0.0.0.0 -ui # minimal server options
networks:
- backend
#-------------------------------------------
# MARIADB
#-------------------------------------------
mariadb:
depends_on:
- consul
build:
context: ./mariadb
ports:
- "${MARIADB_PORT}:3306"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DATA_SAVE}/mariadb:/var/lib/mysql # volume for data
environment:
- CONSUL_MARIADB_AGENT=${CONSUL_MARIADB_AGENT} # consul agent hostname/IP
#- CONSUL_MARIADB_PORT=8500 # consul agent port
#- CONSUL_MARIADB_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_MARIADB_SERVICENAME=mariadb # consul service name
- CONSUL_MARIADB_SERVICETAGS=dev # consul service tag
- CONSUL_MARIADB_SERVICEPORT=3306 # consul service port
- CONSUL_MARIADB_CHECKTYPE=tcp # consul health check type
#- MARIADB_PROFILE=my-small # default configuration profile to use (my-small, my-medium ...)
- MARIADB_ROOTPASSWORD=${MARIADB_ROOTPASSWORD} # root password
#- MARIADB_ROOTHOSTMASK=${MARIADB_ROOTHOSTMASK} # root user hostmask (optional)
- MARIADB_DATABASE=${MARIADB_DATABASE} # create database (optional)
- MARIADB_USERNAME=${MARIADB_USERNAME} # grant user name (optional)
- MARIADB_PASSWORD=${MARIADB_PASSWORD} # grant user password (optional)
- MARIADB_HOSTMASK=${MARIADB_HOSTMASK} # grant user hostmask (optional)
#- MARIADB_CONFIGSCRIPT=${MARIADB_CONFIGSCRIPT} # custom configuration script
networks:
- backend
#-------------------------------------------
# MONGODB
#-------------------------------------------
mongodb:
depends_on:
- consul
build:
context: ./mongodb
ports:
- "${MONGODB_PORT}:27017"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DATA_SAVE}/mongodb:/data/db # volume for data
environment:
- CONSUL_MONGODB_AGENT=${CONSUL_MONGODB_AGENT} # consul agent hostname/IP
#- CONSUL_MONGODB_PORT=8500 # consul agent port
#- CONSUL_MONGODB_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_MONGODB_SERVICENAME=mongodb # consul service name
- CONSUL_MONGODB_SERVICETAGS=dev # consul service tag
- CONSUL_MONGODB_SERVICEPORT=27017 # consul service port
- CONSUL_MONGODB_CHECKTYPE=tcp # consul health check type
#- MONGODB_PROFILE=my-small # default configuration profile to use (my-small, my-medium ...)
#- MONGODB_CONFIGSCRIPT=${MONGODB_CONFIGSCRIPT} # custom configuration script
networks:
- backend
#-------------------------------------------
# NGINX
#-------------------------------------------
nginx:
depends_on:
- consul
build:
context: ./nginx
ports:
- "${NGINX_HTTP_PORT}:80"
- "${NGINX_SSL_PORT}:443"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DATA_SAVE}/nginx:/var/cache/nginx # volume for nginx cache
- ${DATA_SAVE}/www:/var/www # volume for data
environment:
- CONSUL_NGINX_AGENT=consul # consul agent hostname/IP
- CONSUL_NGINX_SERVICENAME=nginx # consul service name
- CONSUL_NGINX_SERVICETAGS=dev # consul service tag
- CONSUL_NGINX_SERVICEPORT=${CONSUL_NGINX_SERVICEPORT} # consul service port
- CONSUL_NGINX_CHECKTYPE=tcp # consul health check type
networks:
- frontend
- backend
#-------------------------------------------------------------------
# NODEJS
#-------------------------------------------------------------------
nodejs:
build:
context: ./nodejs
ports:
- "${NODEJS_PORT}:22"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PATH_APPLICATION}:/home/docker/workspace
environment:
- CONSUL_NODEJS_AGENT=${CONSUL_NODEJS_AGENT} # consul agent hostname/IP
#- CONSUL_NODEJS_PORT=8500 # consul agent port
#- CONSUL_NODEJS_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_NODEJS_SERVICENAME=nodejs # consul service name
- CONSUL_NODEJS_SERVICETAGS=dev # consul service tag
- CONSUL_NODEJS_SERVICEPORT=22 # consul service port
- CONSUL_NODEJS_CHECKTYPE=tcp # consul health check type
- NODE_VERSION=${NODE_VERSION}
- NPM_VERSION=${NPM_VERSION}
- YARN_VERSION=${YARN_VERSION}
networks:
- frontend
- backend
#-------------------------------------------------------------------
# POSTGRESQL
#-------------------------------------------------------------------
postgresql:
depends_on:
- consul
build:
context: ./postgresql
ports:
- "${POSTGRESQL_PORT}:5432"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DATA_SAVE}/postgres:/var/lib/postgresql # volume for data
environment:
- CONSUL_POSTGRES_AGENT=consul # consul agent hostname/IP
#- CONSUL_POSTGRES_PORT=8500 # consul agent port
#- CONSUL_POSTGRES_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_POSTGRES_SERVICENAME=postgresql # consul service name
- CONSUL_POSTGRES_SERVICETAGS=dev # consul service tag
- CONSUL_POSTGRES_SERVICEPORT=${CONSUL_POSTGRES_SERVICEPORT} # consul service port
- CONSUL_POSTGRES_CHECKTYPE=tcp # consul health check type
- POSTGRESQL_DATABASE=${POSTGRESQL_DATABASE} # create database (optional)
- POSTGRESQL_USERNAME=${POSTGRESQL_USERNAME} # grant user name (optional)
- POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD} # grant user password (optional)
- POSTGRESQL_ADDRESS=${POSTGRESQL_ADDRESS} # grant user address (optional)
#- POSTGRESQL_CONFIGSCRIPT=${POSTGRESQL_CONFIGSCRIPT} # custom configuration script
networks:
- backend
#-------------------------------------------------------------------
# REDIS
#-------------------------------------------------------------------
redis:
depends_on:
- consul
build:
context: ./redis
ports:
- "${REDIS_PORT}:6379"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DATA_SAVE}/redis:/var/lib/redis # volume for data
environment:
- CONSUL_REDIS_AGENT=consul # consul agent hostname/IP
#- CONSUL_REDIS_PORT=8500 # consul agent port
#- CONSUL_REDIS_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_REDIS_SERVICENAME=redis # consul service name
- CONSUL_REDIS_SERVICETAGS=dev # consul service tag
- CONSUL_REDIS_SERVICEPORT=6379 # consul service port
- CONSUL_REDIS_CHECKTYPE=tcp # consul health check type
networks:
- backend
#-------------------------------------------------------------------
# VIM
#-------------------------------------------------------------------
vim:
depends_on:
- consul
build:
context: ./vim
ports:
- "${VIM_PORT}:22"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PATH_APPLICATION}:/home/docker/workspace
environment:
- VIM_VERSION=${VIM_VERSION}
- LUA_VERSION=${LUA_VERSION}
- LUAROCKS_VERSION=${LUAROCKS_VERSION}
- CONSUL_VIM_AGENT=${CONSUL_VIM_AGENT} # consul agent hostname/IP
#- CONSUL_VIM_PORT=8500 # consul agent port
#- CONSUL_VIM_EFIX=path/prefix/ # consul key prefix path
- CONSUL_VIM_NAME=vim # consul service name
- CONSUL_VIM_TAGS=dev # consul service tag
- CONSUL_VIM_PORT=22 # consul service port
- CONSUL_VIM_TYPE=tcp # consul health check type
networks:
- backend
#-------------------------------------------------------------------
# PYTHON
#-------------------------------------------------------------------
python:
depends_on:
- consul
build:
context: ./python
ports:
- "${PYTHON_PORT}:22"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PATH_APPLICATION}:/home/docker/workspace
environment:
- CONSUL_PYTHON_AGENT=${CONSUL_PYTHON_AGENT} # consul agent hostname/IP
#- CONSUL_PYTHON_PORT=8500 # consul agent port
#- CONSUL_PYTHON_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_PYTHON_SERVICENAME=python # consul service name
- CONSUL_PYTHON_SERVICETAGS=dev # consul service tag
- CONSUL_PYTHON_SERVICEPORT=22 # consul service port
- CONSUL_PYTHON_CHECKTYPE=tcp # consul health check type
networks:
- backend
#-------------------------------------------
# RUBY
#-------------------------------------------
ruby:
depends_on:
- consul
build:
context: ./ruby
ports:
- "${RUBY_PORT}:22"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PATH_APPLICATION}:/home/docker/workspace
environment:
- CONSUL_RUBY_AGENT=${CONSUL_RUBY_AGENT} # consul agent hostname/IP
#- CONSUL_RUBY_PORT=8500 # consul agent port
#- CONSUL_RUBY_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_RUBY_SERVICENAME=ruby # consul service name
- CONSUL_RUBY_SERVICETAGS=dev # consul service tag
- CONSUL_RUBY_SERVICEPORT=22 # consul service port
- CONSUL_RUBY_CHECKTYPE=tcp # consul health check type
- RUBY_VERSION=${RUBY_VERSION}
networks:
- backend
#-------------------------------------------
# APPLICATION
#-------------------------------------------
application:
depends_on:
- consul
build:
context: ./application
ports:
- "${APPLICATION_PORT}:22"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PATH_APPLICATION}:/home/docker/workspace
environment:
- CONSUL_APPLICATION_AGENT=consul # consul agent hostname/IP
#- CONSUL_APPLICATION_PORT=8500 # consul agent port
#- CONSUL_APPLICATION_KEYPREFIX=path/prefix/ # consul key prefix path
- CONSUL_APPLICATION_SERVICENAME=application # consul service name
- CONSUL_APPLICATION_SERVICETAGS=dev # consul service tag
- CONSUL_APPLICATION_SERVICEPORT=22 # consul service port
- CONSUL_APPLICATION_CHECKTYPE=tcp # consul health check type
- RUBY_VERSION=${RUBY_VERSION}
networks:
- frontend
- backend
#-------------------------------------------------------------------
# NETWORK SETUP
#-------------------------------------------------------------------
networks:
frontend:
driver: "bridge"
backend:
driver: "bridge"
#-------------------------------------------------------------------
# VOLUME SETUP
#-------------------------------------------------------------------
volumes:
mariadb:
driver: "local"
mongodb:
driver: "local"
nginx:
driver: "local"
nodejs:
driver: "local"
postgresql:
driver: "local"
redis:
driver: "local"
ruby:
driver: "local"
python:
driver: "local"
vim:
driver: "local"
application:
driver: "local"