-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·238 lines (215 loc) · 5.86 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
237
238
version: '2'
services:
backend:
build: builds/backend
volumes:
- ${BACKEND_PATH}:/var/www/flex-spa/backend-app
environment:
CI_STAGE: ${CI_STAGE}
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
MEMCACHED_HOST: ${MEMCACHED_HOST}
MEMCACHED_PORT: ${MEMCACHED_PORT}
STATSD_HOST: ${STATSD_HOST}
STATSD_PORT: ${STATSD_PORT}
ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST}
ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT}
RABBITMQ_HOST: ${RABBITMQ_HOST}
RABBITMQ_PORT: ${RABBITMQ_PORT}
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
MAILER_URL: ${MAILER_URL}
SENTRY_DSN: ${SENTRY_DSN}
API_JWT_PASSPHRASE: ${API_JWT_PASSPHRASE}
command: bash -c 'echo SKIP'
backend_web:
restart: unless-stopped
extends: backend
ports:
- 9000:9000
links:
- mysql:${MYSQL_HOST}
- redis:${REDIS_HOST}
- memcached:${MEMCACHED_HOST}
- elasticsearch:${ELASTICSEARCH_HOST}
- rabbitmq:${RABBITMQ_HOST}
- grafana:${STATSD_HOST}
- sentry_web:${SENTRY_HOST}
volumes:
- ${BACKEND_PATH}:/var/www/flex-spa/backend-app
command: php-fpm
backend_worker:
restart: unless-stopped
extends: backend
links:
- mysql:${MYSQL_HOST}
- redis:${REDIS_HOST}
- memcached:${MEMCACHED_HOST}
- elasticsearch:${ELASTICSEARCH_HOST}
- rabbitmq:${RABBITMQ_HOST}
- sentry_web:${SENTRY_HOST}
volumes:
- ${BACKEND_PATH}:/var/www/flex-spa/backend-app
- ./log/supervisor:/var/log/supervisor
# command: php-fpm
command: bash -c 'cp /var/www/flex-spa/backend-app/config/workers/* /etc/supervisord/ && supervisord'
backend_cron:
restart: unless-stopped
extends: backend
links:
- mysql:${MYSQL_HOST}
- redis:${REDIS_HOST}
- memcached:${MEMCACHED_HOST}
- elasticsearch:${ELASTICSEARCH_HOST}
- sentry_web:${SENTRY_HOST}
volumes:
- ${BACKEND_PATH}:/var/www/flex-spa/backend-app
- ./log/cron:/var/log
command: bash -c 'cron && touch /var/log/backend-cron.log && tail -f /var/log/backend-cron.log'
frontend:
build: builds/frontend
volumes:
- ${FRONTEND_PATH}:/var/app
command: bash -c 'npm i && npm run build && npm run start'
ports:
- 1337:1337
nginx:
build: builds/nginx
ports:
- ${APP_PORT}:80
links:
- backend_web
- frontend
volumes:
- ${BACKEND_PATH}:/var/www/flex-spa/backend-app
- ./log/nginx:/var/log/nginx
mysql:
image: mysql:5.7
volumes:
- ./data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- 3306:3306
redis:
image: redis:alpine
ports:
- ${REDIS_PORT}:6379
memcached:
image: memcached:alpine
ports:
- ${MEMCACHED_PORT}:11211
elasticsearch:
image: elasticsearch:alpine
environment:
ES_JAVA_OPTS: "-Xms768m -Xmx768m"
ports:
- ${ELASTICSEARCH_PORT}:9200
- 9300:9300 #node communication
rabbitmq:
image: rabbitmq:3.7.3-management-alpine
ports:
- ${RABBITMQ_PORT}:5672
- 15672:15672 #management listener
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
phpmemadmin:
build: builds/phpmemadmin
ports:
- ${PHPMEMADMIN_PORT}:80
environment:
MEMCACHED_HOST: ${MEMCACHED_HOST}
MEMCACHED_PORT: ${MEMCACHED_PORT}
links:
- memcached:${MEMCACHED_HOST}
phpredisadmin:
build: builds/phpredisadmin
environment:
- ADMIN_USER=${REDIS_ADMIN_USER}
- ADMIN_PASS=${REDIS_ADMIN_PASSWORD}
- REDIS_1_HOST=${REDIS_HOST}
- REDIS_1_PORT=${REDIS_PORT}
links:
- redis:${REDIS_HOST}
ports:
- ${PHPREDISADMIN_PORT}:80
elastichq:
image: elastichq/elasticsearch-hq:latest
ports:
- ${ELASTICHQ_PORT}:5000
links:
- elasticsearch:${ELASTICSEARCH_HOST}
grafana:
image: kamon/grafana_graphite
ports:
- ${GRAFANA_PORT}:80
- ${GRAPHITE_PORT}:81
- ${STATSD_PORT}:8125/udp
- 8126:8126 #statsd admin port
- 2003:2003 #graphite data port
volumes:
- ./data/whisper:/opt/graphite/storage/whisper
- ./data/grafana:/opt/grafana/data
- ./log/graphite:/opt/graphite/storage/log
- ./log/supervisor:/var/log/supervisor
sentry:
restart: unless-stopped
image: sentry:8.22-onbuild
environment:
SENTRY_SECRET_KEY: ${SENTRY_SECRET_KEY}
SENTRY_MEMCACHED_HOST: sentry_memcached
SENTRY_REDIS_HOST: sentry_redis
SENTRY_POSTGRES_HOST: sentry_postgres
SENTRY_EMAIL_HOST: sentry_smtp
volumes:
- ./data/sentry:/var/lib/sentry/files
sentry_memcached:
restart: unless-stopped
image: memcached:1.4
sentry_redis:
restart: unless-stopped
image: redis:3.2-alpine
sentry_postgres:
restart: unless-stopped
image: postgres:9.5
volumes:
- ./data/postgres:/var/lib/postgresql/data
sentry_smtp:
restart: unless-stopped
image: tianon/exim4
sentry_web:
restart: unless-stopped
extends: sentry
links:
- sentry_memcached
- sentry_redis
- sentry_postgres
- sentry_smtp
ports:
- ${SENTRY_PORT}:9000
sentry_cron:
restart: unless-stopped
extends: sentry
links:
- sentry_memcached
- sentry_redis
- sentry_postgres
- sentry_smtp
command: run cron
sentry_worker:
restart: unless-stopped
extends: sentry
links:
- sentry_memcached
- sentry_redis
- sentry_postgres
- sentry_smtp
command: run worker