This repository was archived by the owner on Nov 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.override.yml
251 lines (232 loc) · 7.18 KB
/
docker-compose.override.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
version: '2'
volumes:
node_modules:
driver: local
elasticsearch_data:
driver: local
services:
serverworker:
image: dionjwa/haxe-watch:v0.7.3
cpu_shares: 1024
expose:
- 9000
# Extra args for debugging: --inspect, --debug-brk
command: ["nodemon", "-L", "-w", "server", "server/cloud-compute-cannon-server.js"]
links:
- redis
- fluentd
working_dir: /app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./build/server:/app/server
- ./clients/dashboard/build:/app/clients/dashboard
- ./src/web:/app/web
- ./ccc-local-storage:/app/ccc- local-storage
- ./package.json:/app/package.json
- node_modules:/app/node_modules
environment:
- PORT=9000
- STORAGE_HTTP_PREFIX=http://ccc.local
- REDIS_HOST=redis
- VIRTUAL_HOST=ccc.local
- FLUENT_HOST=fluentd
- LOG_LEVEL=debug
- WORKER_STATUS_CHECK_INTERVAL_SECONDS=20
labels:
ccc.type: "worker"
ccc.origin: "docker-compose"
# Run the functional and scaling tests in a separate container
ccc.tests:
image: dionjwa/haxe-watch:v0.7.3
working_dir: /app
# command: ["nodemon", "-L", "--delay", "5", "--watch", "build/test", "--watch", "build/server", "build/test/cloud-compute-cannon-tester.js"]
command: ["nodemon", "-L", "--watch", "build/test", "build/test/cloud-compute-cannon-tester.js"]
environment:
- CCC=ccc.local
- CCC_SCALING=ccc-scaling-server:4015
- LOG_LEVEL=debug
- REDIS_HOST=redis
- TEST=${TEST}
- TEST_SCALING=${TEST_SCALING}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./build:/app/build
- node_modules:/app/node_modules
links:
- ccc.local
- redis
- ccc-scaling-server
redis:
cpu_shares: 256
restart: always
image: redis:3.2.0-alpine
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "6379"
volumes:
- ./etc/redis/redis-dev.conf:/usr/local/etc/redis/redis.conf
logging:
driver: none
#Examine redis db
redis-commander:
cpu_shares: 256
image: tenstartups/redis-commander
command: --redis-host redis
links:
- redis
ports:
- "8083:8081"
logging:
driver: none
# Replicates (mocks) e.g. AWS AutoScalingGroups, by creating and destroying
# workers based on the desired capacity.
# Also used to test worker failure
ccc-scaling-server:
cpu_shares: 512
image: dionjwa/haxe-watch:v0.7.3
command: ["nodemon", "-L", "local-scaling-server/cloud-compute-cannon-scaling-server.js"]
working_dir: /app
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./build/local-scaling-server:/app/local-scaling-server
- node_modules:/app/node_modules
environment:
- PORT=4015
- REDIS_HOST=redis
- CCC=http://ccc.local
- LOG_LEVEL=40
ports:
- "4015:4015"
links:
- redis
- ccc.local
depends_on:
- serverworker
# The internal scaling service (mocks e.g. an AWS autoscaling group)
# creates and destroys workers dynamically. This container detects
# new workers and modifies the nginx config to reverse proxy the
# workers a single API endpoint can be used.
ccc.local:
image: jwilder/nginx-proxy
ports:
- "8080:80"
environment:
- DEFAULT_HOST=ccc.local
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./etc/nginx/ccc.local.conf:/etc/nginx/vhost.d/ccc.local
- ./etc/nginx/proxy.conf:/etc/nginx/proxy.conf
depends_on:
- serverworker
logging:
driver: none
# Simply installs npm modules into a persistent docker volume
# for efficiency. Used by reloaders, not the main app
# Only installs modules if INSTALL=true|1
node_modules:
image: dionjwa/node_modules
working_dir: /app
# Only install node modules if INSTALL=true or INSTALLL=1
command: ["/bin/sh", "-c", 'if [ "x$INSTALL" = "xtrue" ] || [ "x$INSTALL" = "x1" ]; then npm i; fi']
environment:
- INSTALL
volumes:
- node_modules:/app/node_modules
- ./package.json:/app/package.json
# Only installs if INSTALL=true|1
haxelibs:
image: dionjwa/haxe-watch:v0.7.3
# Only install haxe modules if INSTALL=true or INSTALLL=1
command: ["/bin/sh", "-c", 'if [ "x$INSTALL" = "xtrue" ] || [ "x$INSTALL" = "x1" ]; then haxelib install --always etc/hxml/build-all.hxml; fi']
working_dir: /app
environment:
- INSTALL
volumes:
- ./.haxelib:/app/.haxelib
- ./etc:/app/etc
- ./clients:/app/clients
- ./test:/app/test
#This will always run on startup. There's no reason why it should't
compile:
image: dionjwa/haxe-watch:v0.7.3
command: ["haxe", "etc/hxml/build-all.hxml"]
working_dir: /app
volumes:
- ./.git:/app/.git
- ./build:/app/build
- ./.haxelib:/app/.haxelib
- ./src:/app/src
- ./etc:/app/etc
- ./clients:/app/clients
- ./test:/app/test
fluentd:
build: ./etc/log/
volumes:
- ./etc/log/fluent.elasticsearch.conf:/fluentd/etc/fluent.conf
links:
- elasticsearch
logging:
driver: none
elasticsearch:
image: elasticsearch:2.4.5-alpine
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
logging:
driver: none
kibana:
image: kibana:4.6.6
ports:
- "5601:5601"
environment:
ELASTICSEARCH_URL: "http://elasticsearch:9200"
links:
- elasticsearch
logging:
driver: none
# Watches code changes for the ccc-scaling-server and recompiles the code
# watch-compiler-ccc-scaling-server:
# image: dionjwa/haxe-watch:v0.7.3
# working_dir: /app
# command: ["/bin/bash", "-c", "chokidar --initial --verbose -c 'haxe test/services/local-scaling-server/build.hxml' test/services/local-scaling-server/src/*.hx"]
# volumes:
# - ./:/app
# - ./.haxelib:/app/.haxelib
# logging:
# driver: none
# # Watches code changes for the server tester and recompiles
# # ccc.tests-watch-compiler:
# # image: dionjwa/haxe-watch:v0.7.3
# # working_dir: /app
# # command: ["/bin/bash", "-c", "chokidar --initial --verbose -c 'haxe etc/hxml/build-tester.hxml' test/services/stand-alone-tester/src/**/*.hx"]
# # volumes:
# # - ./src:/app/src
# # - ./clients:/app/clients
# # - ./etc:/app/etc
# # - ./test:/app/test
# # - ./.haxelib:/app/.haxelib
# # logging:
# # driver: none
# client-dashboard-watch:
# cpu_shares: 512
# image: dionjwa/haxe-watch:v0.7.3
# working_dir: /app
# command: ["/bin/bash", "-c", "chokidar --initial --verbose -c 'mkdir -p build && rsync -rptgoDv --copy-links web/* build/' web/**/*.css web/**/*.js web/**/*.html"]
# volumes:
# - ./clients/dashboard:/app
# logging:
# driver: none
# livereload:
# cpu_shares: 512
# image: dionjwa/livereloadx
# command: ["livereloadx", "-p", "35729", "--proxy", "http://server:9000", "--prefer-local", "/app/build"]
# ports:
# - "35729:35729"
# volumes:
# - ./clients/dashboard:/app/
# links:
# - serverworker:server
# logging:
# driver: none