forked from nystudio107/plugindev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·172 lines (169 loc) · 4.96 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
version: '3.7'
networks:
default:
name: plugindev_default
services:
# nginx - web server
nginx:
build:
context: ./docker-config/nginx
dockerfile: ./Dockerfile
init: true
ports:
- "8003:8003"
- "8004:8004"
volumes:
- cpresources_v3:/var/www/project/cms_v3/web/cpresources:delegated
- cpresources_v4:/var/www/project/cms_v4/web/cpresources:delegated
- ./cms_v3/web:/var/www/project/cms_v3/web:cached
- ./cms_v4/web:/var/www/project/cms_v4/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 test"
MYSQL_USER: project
MYSQL_PASSWORD: project
init: true
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
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "postgres"
- "redis"
env_file: &env_v3
- ./cms_v3/.env
init: true
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
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "postgres"
- "redis"
env_file: &env_v4
- ./cms_v4/.env
init: true
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_xdebug_v3 - run php-fpm with xdebug
php_xdebug_v3:
build:
context: ./docker-config/php-dev-craft
dockerfile: ./Dockerfile
depends_on:
- "php_v3"
env_file:
*env_v3
init: true
tty: true
volumes:
*php-volumes_v3
# php_xdebug_v4 - run php-fpm with xdebug
php_xdebug_v4:
build:
context: ./docker-config/php-dev-craft
dockerfile: ./Dockerfile
depends_on:
- "php_v4"
env_file:
*env_v4
init: true
tty: true
volumes:
*php-volumes_v4
# postgres - database
postgres:
build:
context: ./docker-config/postgres
dockerfile: ./Dockerfile
environment:
POSTGRES_DATABASES: "project_v3 project_v4 test"
POSTGRES_USER: project
POSTGRES_PASSWORD: project
init: true
ports:
- "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
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
tty: true
volumes:
*php-volumes_v4
# 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:
storage_v3:
storage_v4: