-
Notifications
You must be signed in to change notification settings - Fork 38
/
docker-compose.yml
145 lines (135 loc) · 4.23 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
version: "3"
services:
### MySQL Container #########################################
mysql:
hostname: mysql
container_name: mysql
image: mysql:5.7
volumes:
- mysql:/var/lib/mysql:delegated
ports:
- "3306:3306"
networks:
- backend
environment:
- MYSQL_VERSION=5.7
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=homestead
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
### Redis Container #########################################
redis:
hostname: redis
container_name: redis
image: redis:latest
ports:
- "6379:6379"
networks:
- backend
### Composer Container ######################################
composer:
hostname: composer
container_name: composer
image: crunchgeek/composer:7.2
working_dir: /app
command: [ "bash", "-c", "composer require predis/predis && composer require laravel/horizon && composer install && touch /tmp/log && tail -f /tmp/log" ]
volumes:
- ./laravel-project:/app:cached
- vendor:/app/vendor
### NODE Container ##########################################
node:
hostname: node
container_name: node
working_dir: /app
image: node:6.14.4
command: [ "bash", "-c", "npm i --save && npm run watch" ]
depends_on:
- composer
volumes:
- ./laravel-project:/app:cached
- node:/app/node_modules
- vendor:/app/vendor
### PHP-FPM Container #######################################
php:
hostname: php
container_name: php
image: crunchgeek/php-fpm:7.2
working_dir: /app
volumes:
- vendor:/app/vendor
- storage:/app/storage
- ./laravel-project:/app:delegated
- ./infrastructure:/config:delegated
depends_on:
- node
- redis
- mysql
- composer
networks:
- backend
environment:
# more info at: https://github.com/markhilton/docker-php-fpm
- PHP_UID=9000
- PHP_GID=9000
- PHP_USER=php-fpm
- PHP_HOME=/app
- PHP_POOL_PATH=/config/www.conf
- PHP_BOOT_SCRIPTS=/config/provision.sh
- PHP_CRONTABS_PATH=/config/artisan.crontab
# overwrite default Laravel environment
- DB_HOST=mysql
- REDIS_HOST=redis
- CACHE_DRIVER=redis
- SESSION_DRIVER=redis
- QUEUE_CONNECTION=redis
# if supervisord if ON then php-fpm is OFF
# - SUPERVISORD_PATH=/config/supervisord.conf
### Nginx Server Container ##################################
nginx:
hostname: frontend
container_name: frontend
image: crunchgeek/nginx-pagespeed:latest
working_dir: /app
volumes:
- ./laravel-project:/app:delegated
- ./laravel-project/public:/app/public:delegated
- uploads:/app/public/storage:delegated
- ./infrastructure:/config:delegated
ports:
- "80:80"
- "8080:8080"
links:
- php
networks:
- frontend
- backend
environment:
# more info at: https://github.com/markhilton/docker-nginx-pagespeed
- NGINX_INCLUDE_PATH=/config/nginx.conf
- NGINX_FASTCGI_GEOIP=on
- NGINX_DEFAULT_SERVER=off
- NGINX_PAGESPEED=off
- NGINX_PAGESPEED_JS=off
- NGINX_PAGESPEED_CSS=off
- NGINX_PAGESPEED_IMG=off
- NGINX_PAGESPEED_STORAGE=files
### Networks Setup ############################################
networks:
frontend:
driver: "bridge"
backend:
driver: "bridge"
### Volumes Setup ###########################################
volumes:
mysql:
driver: "local"
node:
driver: "local"
uploads:
driver: "local"
storage:
driver: "local"
vendor:
driver: "local"