-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
235 lines (219 loc) · 5.52 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
version: '2'
services:
# Applications Code
app:
image: tianon/true
volumes:
- ${APPLICATION}:/var/www
- ${MAPSERVER_DATA}:/usr/local/share/mapserver
# Workspace Utilities
workspace:
build:
context: ./etc/workspace
args:
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
- INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS}
- INSTALL_AMQP=${WORKSPACE_INSTALL_AMQP}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS}
- INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK}
- PUID=${WORKSPACE_PUID}
- PGID=${WORKSPACE_PGID}
- TZ=${WORKSPACE_TIMEZONE}
- BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
- BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}
dockerfile: "Dockerfile-${PHP_VERSION}"
volumes_from:
- app
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
ports:
- ${WORKSPACE_SSH_PORT}:22
tty: true
networks:
- frontend
- backend
# Instance PHP
php:
build:
context: ./etc/php
args:
- INSTALL_XDEBUG=${PHP_INSTALL_XDEBUG}
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
- INSTALL_ZIP_ARCHIVE=${PHP_FPM_INSTALL_ZIP_ARCHIVE}
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
- INSTALL_AMQP=${PHP_FPM_INSTALL_AMQP}
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
- INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER}
- INSTALL_INTL=${PHP_FPM_INSTALL_INTL}
- INSTALL_GMP=${PHP_FPM_INSTALL_GMP}
- INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS}
- INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK}
dockerfile: "Dockerfile-${PHP_VERSION}"
volumes_from:
- app
volumes:
- ${PHP_LOG_PATH}:/var/log/php
expose:
- "9000"
depends_on:
- workspace
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
networks:
- backend
# Instance Nginx
nginx:
build:
context: ./etc/nginx
args:
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
volumes_from:
- app
volumes:
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
ports:
- ${NGINX_HOST_HTTP_PORT}:80
- ${NGINX_HOST_HTTPS_PORT}:443
links:
- mapserver
depends_on:
- php
networks:
- frontend
- backend
# Instance DB
db:
build: ./etc/db
volumes:
- ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT}:5432
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- backend
# Instance MapServer
mapserver:
build: ./etc/mapserver
volumes_from:
- app
volumes:
- ${MAPSERVER_DATA}:/usr/local/share/mapserver
- ${MAPSERVER_LOG_PATH}:/var/log/mapserver
ports:
- 8080:8080
networks:
- backend
# Instance Redis
redis:
build: ./etc/redis
volumes:
- ${DATA_SAVE_PATH}/redis:/data
ports:
- ${REDIS_PORT}:6379
networks:
- backend
# Instance RabbitMQ
rabbitmq:
build: ./etc/rabbitmq
ports:
- "${RABBITMQ_NODE_HOST_PORT}:5672"
- "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672"
- "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671"
privileged: true
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
depends_on:
- php
networks:
- backend
### ELK Stask
# Instance ElasticSearch
elasticsearch:
build: ./etc/elasticsearch
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
environment:
- cluster.name=dockermygis-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
ports:
- ${ELASTICSEARCH_HOST_HTTP_PORT}:9200
- ${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300
depends_on:
- php
networks:
- frontend
- backend
# Instance Kibana
kibana:
build: ./etc/kibana
ports:
- ${KIBANA_HTTP_PORT}:5601
depends_on:
- elasticsearch
networks:
- frontend
- backend
# Instance LogStash
logstash:
build: ./etc/logstash
volumes:
- ${LOGSTASH_PIPELINE}:/usr/share/logstash/pipeline
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
ports:
- ${LOGSTASH_HTTP_PORT}:5000
depends_on:
- elasticsearch
### Tool for Dev
# Instance MailDev
maildev:
build: ./etc/maildev
ports:
- ${MAILDEV_HTTP_PORT}:80
- ${MAILDEV_SMTP_PORT}:25
networks:
- frontend
- backend
# Instance Blackfire
blackfire:
image: blackfire/blackfire
environment:
- BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID}
- BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN}
depends_on:
- php
networks:
- backend
# Networks Setup
networks:
frontend:
driver: "bridge"
backend:
driver: "bridge"
# Volumes Setup
volumes:
postgres:
driver: "local"
redis:
driver: "local"
elasticsearch-data:
driver: "local"
elasticsearch-plugins:
driver: "local"