forked from nystudio107/plugindev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·243 lines (240 loc) · 7.27 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
239
240
241
242
243
version: '3.7'
networks:
default:
name: plugindev_default
services:
# nginx - web server
nginx:
build:
context: ./.docker-config/nginx
dockerfile: ./Dockerfile
init: true
labels:
- dev.orbstack.domains=plugindev.local
ports:
- "8003:8003"
- "8004:8004"
- "8005:8005"
volumes:
- cpresources_v3:/var/www/project/cms_v3/web/cpresources:delegated
- cpresources_v4:/var/www/project/cms_v4/web/cpresources:delegated
- cpresources_v5:/var/www/project/cms_v5/web/cpresources:delegated
- ./cms_v3/web:/var/www/project/cms_v3/web:cached
- ./cms_v4/web:/var/www/project/cms_v4/web:cached
- ./cms_v5/web:/var/www/project/cms_v5/web:cached
# mysql - database
mysql:
build:
context: ./.docker-config/mysql
dockerfile: ./Dockerfile
cap_add:
- SYS_NICE # CAP_SYS_NICE
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASES: "project_v3 project_v4 project_v5 test"
MYSQL_USER: project
MYSQL_PASSWORD: project
init: true
labels:
- dev.orbstack.domains=mysql.plugindev.local
ports:
- "33060:3306"
volumes:
- mysql-db-data:/var/lib/mysql
- ./db-seed/mysql:/docker-entrypoint-initdb.d
# php_v3 - run php-fpm
php_v3:
build: &php-build_v3
context: ./.docker-config/php-prod-craft/v3
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "postgres"
- "redis"
env_file: &env_v3
- ./cms_v3/.env
init: true
stop_grace_period: "1s"
tty: true
volumes: &php-volumes_v3
# Change the path below to map to your local plugin repositories
- /Users/andrew/webdev/craft_v3:/Users/andrew/webdev/craft_v3
- cpresources_v3:/var/www/project/cms_v3/web/cpresources:delegated
- storage_v3:/var/www/project/cms_v3/storage:delegated
- ./cms_v3:/var/www/project/cms_v3:cached
# Specific directories that need to be bind-mounted
- ./cms_v3/storage/logs:/var/www/project/cms_v3/storage/logs:delegated
- ./cms_v3/storage/runtime/compiled_templates:/var/www/project/cms_v3/storage/runtime/compiled_templates:delegated
- ./cms_v3/storage/runtime/compiled_classes:/var/www/project/cms_v3/storage/runtime/compiled_classes:delegated
- ./cms_v3/vendor:/var/www/project/cms_v3/vendor:delegated
- ./cms_v3/storage/rebrand:/var/www/project/cms_v3/storage/rebrand:delegated
# php_v4 - run php-fpm
php_v4:
build: &php-build_v4
context: ./.docker-config/php-prod-craft/v4
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "postgres"
- "redis"
env_file: &env_v4
- ./cms_v4/.env
init: true
stop_grace_period: "1s"
tty: true
volumes: &php-volumes_v4
# Change the path below to map to your local plugin repositories
- /Users/andrew/webdev/craft_v4:/Users/andrew/webdev/craft_v4
- cpresources_v4:/var/www/project/cms_v4/web/cpresources:delegated
- storage_v4:/var/www/project/cms_v4/storage:delegated
- ./cms_v4:/var/www/project/cms_v4:cached
# Specific directories that need to be bind-mounted
- ./cms_v4/storage/logs:/var/www/project/cms_v4/storage/logs:delegated
- ./cms_v4/storage/runtime/compiled_templates:/var/www/project/cms_v4/storage/runtime/compiled_templates:delegated
- ./cms_v4/storage/runtime/compiled_classes:/var/www/project/cms_v4/storage/runtime/compiled_classes:delegated
- ./cms_v4/vendor:/var/www/project/cms_v4/vendor:delegated
- ./cms_v4/storage/rebrand:/var/www/project/cms_v4/storage/rebrand:delegated
# php_v5 - run php-fpm
php_v5:
build: &php-build_v5
context: ./.docker-config/php-prod-craft/v5
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "postgres"
- "redis"
env_file: &env_v5
- ./cms_v5/.env
init: true
stop_grace_period: "1s"
tty: true
volumes: &php-volumes_v5
# Change the path below to map to your local plugin repositories
- /Users/andrew/webdev/craft_v5:/Users/andrew/webdev/craft_v5
- cpresources_v5:/var/www/project/cms_v5/web/cpresources:delegated
- storage_v5:/var/www/project/cms_v5/storage:delegated
- ./cms_v5:/var/www/project/cms_v5:cached
# Specific directories that need to be bind-mounted
- ./cms_v5/storage/logs:/var/www/project/cms_v5/storage/logs:delegated
- ./cms_v5/storage/runtime/compiled_templates:/var/www/project/cms_v5/storage/runtime/compiled_templates:delegated
- ./cms_v5/storage/runtime/compiled_classes:/var/www/project/cms_v5/storage/runtime/compiled_classes:delegated
- ./cms_v5/vendor:/var/www/project/cms_v5/vendor:delegated
- ./cms_v5/storage/rebrand:/var/www/project/cms_v5/storage/rebrand:delegated
# php_xdebug_v3 - run php-fpm with xdebug
php_xdebug_v3:
build:
context: ./.docker-config/php-dev-craft/v3
dockerfile: ./Dockerfile
depends_on:
- "php_v3"
env_file:
*env_v3
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v3
# php_xdebug_v4 - run php-fpm with xdebug
php_xdebug_v4:
build:
context: ./.docker-config/php-dev-craft/v4
dockerfile: ./Dockerfile
depends_on:
- "php_v4"
env_file:
*env_v4
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v4
# php_xdebug_v5 - run php-fpm with xdebug
php_xdebug_v5:
build:
context: ./.docker-config/php-dev-craft/v5
dockerfile: ./Dockerfile
depends_on:
- "php_v5"
env_file:
*env_v5
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v5
# postgres - database
postgres:
build:
context: ./.docker-config/postgres
dockerfile: ./Dockerfile
environment:
POSTGRES_DATABASES: "project_v3 project_v4 project_v5 test"
POSTGRES_USER: project
POSTGRES_PASSWORD: project
init: true
labels:
- dev.orbstack.domains=postgres.plugindev.local
expose:
- "54320:5432"
volumes:
- postgres-db-data:/usr/local/pgsql/data
- ./db-seed/postgres:/docker-entrypoint-initdb.d
# queue_v3 - runs queue jobs via php craft queue/listen
queue_v3:
build:
*php-build_v3
command: /var/www/project/run_queue.sh
depends_on:
- "php_v3"
env_file:
*env_v3
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v3
# queue_v4 - runs queue jobs via php craft queue/listen
queue_v4:
build:
*php-build_v4
command: /var/www/project/run_queue.sh
depends_on:
- "php_v4"
env_file:
*env_v4
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v4
# queue_v5 - runs queue jobs via php craft queue/listen
queue_v5:
build:
*php-build_v5
command: /var/www/project/run_queue.sh
depends_on:
- "php_v5"
env_file:
*env_v5
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes_v5
# redis - key/value database for caching & php sessions
redis:
build:
context: ./.docker-config/redis
dockerfile: ./Dockerfile
expose:
- "6379"
init: true
volumes:
mysql-db-data:
postgres-db-data:
cpresources_v3:
cpresources_v4:
cpresources_v5:
storage_v3:
storage_v4:
storage_v5: