-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose-varnish.yml
243 lines (231 loc) · 5.2 KB
/
docker-compose-varnish.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
version: "3.2"
services:
## Nginx Web Container ###
nginx:
build: ./core/images/nginx
container_name: nginx
volumes:
- type: bind
source: ./www
target: /var/www/html
- ./core/conf/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./core/conf/nginx/conf/conf.d:/etc/nginx/conf.d:ro
- ./web-conf:/etc/nginx/web-conf:ro
- ./logs/nginx/log:/var/log/nginx:rw
- type: bind
source: ./share-files
target: /var/www/share-files
- type: bind
source: ./ssl
target: /var/www/ssl
ports:
- "80:80"
- "443:443"
- "8080:80"
- "8035:80"
restart: always
networks:
- net-php70
- net-php71
- net-php72
- net-varnish
depends_on:
- php70
- php71
- php72
### PHP FPM Container ###
php70:
build: ./core/images/php70
container_name: php70
volumes:
- type: bind
source: ./www
target: /var/www/html
- ./core/conf/php70/conf/php.ini:/etc/php7/php.ini:ro
- ./core/conf/php70/conf/php-fpm.conf:/etc/php7/php-fpm.conf:ro
- ./core/conf/php70/conf/conf.d/www.conf:/etc/php7/php-fpm.d/www.conf:ro
- type: bind
source: ../.ssh
target: /root/.ssh
- type: bind
source: ./share-files
target: /var/www/share-files
expose:
- "9070"
restart: always
networks:
- net-php70
- net-mysql
- net-elasticsearch
- net-redis
depends_on:
- mysql
- elasticsearch
- redis
php71:
build: ./core/images/php71
container_name: php71
volumes:
- type: bind
source: ./www
target: /var/www/html
- ./core/conf/php71/conf/php.ini:/etc/php7/php.ini:ro
- ./core/conf/php71/conf/php-fpm.conf:/etc/php7/php-fpm.conf:ro
- ./core/conf/php71/conf/conf.d/www.conf:/etc/php7/php-fpm.d/www.conf:ro
- type: bind
source: ../.ssh
target: /root/.ssh
- type: bind
source: ./share-files
target: /var/www/share-files
expose:
- "9071"
restart: always
networks:
- net-php71
- net-mysql
- net-elasticsearch
- net-redis
depends_on:
- mysql
- elasticsearch
- redis
php72:
build: ./core/images/php72
container_name: php72
volumes:
- type: bind
source: ./www
target: /var/www/html
- ./core/conf/php72/conf/php.ini:/etc/php7/php.ini:ro
- ./core/conf/php72/conf/php-fpm.conf:/etc/php7/php-fpm.conf:ro
- ./core/conf/php72/conf/php-fpm.d/www.conf:/etc/php7/php-fpm.d/www.conf:ro
- type: bind
source: ../.ssh
target: /root/.ssh
- type: bind
source: ./share-files
target: /var/www/share-files
ports:
- "3000:3000"
- "35729:35729"
expose:
- "9000"
restart: always
networks:
- net-php72
- net-mysql
- net-elasticsearch
- net-redis
depends_on:
- mysql
- elasticsearch
- redis
### MYSQL Container ###
mysql:
build: ./core/images/mysql
container_name: mysql
volumes:
- type: volume
source: db-mysql
target: /var/lib/mysql
volume:
nocopy: true
- ./core/conf/mysql/conf/my.cnf:/etc/mysql/my.cnf:ro
- type: bind
source: ./share-files
target: /var/www/share-files
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: 123456
restart: always
networks:
- net-mysql
### ELASTICSEARCH Container ###
elasticsearch:
image: elasticsearch:6.7.2
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- "9200:9200"
networks:
- net-elasticsearch
### REDIS Container ###
redis:
build: ./core/images/redis
container_name: redis
volumes:
- redisdata:/data
ports:
- "6379:6379"
networks:
- net-redis
### PHPMYADMIN Container ###
phpmyadmin:
build: ./core/images/phpmyadmin
container_name: phpmyadmin
environment:
- PMA_HOST=mysql
- PMA_PORT=3306
- PMA_USER=root
- PMA_PASSWORD=123456
ports:
- "3307:80"
restart: always
networks:
- net-phpmyadmin
- net-mysql
depends_on:
- mysql
### Varnish Container ###
varnish:
build: ./core/images/varnish
container_name: varnish
volumes:
- ./web-conf/default.vcl:/etc/varnish/default.vcl:ro
ports:
- "8081:80"
restart: always
networks:
- net-varnish
- net-nginx
depends_on:
- nginx
### Networks Setup ###
networks:
net-php70:
driver: bridge
net-php71:
driver: bridge
net-php72:
driver: bridge
net-mysql:
driver: bridge
net-elasticsearch:
driver: bridge
net-redis:
driver: bridge
net-phpmyadmin:
driver: bridge
net-varnish:
driver: bridge
net-nginx:
driver: bridge
### Volumes Setup ###
volumes:
db-mysql:
driver: local
esdata:
driver: local
redisdata:
driver: local