-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yml
executable file
·119 lines (117 loc) · 2.98 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
version: '3.7'
services:
# nginx - web server
nginx:
build:
context: ./.docker-config/nginx
dockerfile: ./Dockerfile
env_file: &env
- ./cms/.env
init: true
labels:
- dev.orbstack.domains=devmode.local
ports:
- "8000:80"
volumes:
- cpresources:/var/www/project/cms/web/cpresources:delegated
- ./cms/web:/var/www/project/cms/web:cached
# php - run php-fpm
php:
build: &php-build
context: ./.docker-config/php-prod-craft
dockerfile: ./Dockerfile
depends_on:
- "postgres"
- "redis"
env_file:
*env
expose:
- "9000"
init: true
stop_grace_period: "1s"
tty: true
volumes: &php-volumes
- cpresources:/var/www/project/cms/web/cpresources:delegated
- storage:/var/www/project/cms/storage:delegated
- ./cms:/var/www/project/cms:cached
# Specific directories that need to be bind-mounted
- ./cms/storage/logs:/var/www/project/cms/storage/logs:delegated
- ./cms/storage/runtime/compiled_templates:/var/www/project/cms/storage/runtime/compiled_templates:delegated
- ./cms/storage/runtime/compiled_classes:/var/www/project/cms/storage/runtime/compiled_classes:delegated
- ./cms/vendor:/var/www/project/cms/vendor:delegated
# php - run php-fpm with xdebug
php_xdebug:
build:
context: ./.docker-config/php-dev-craft
dockerfile: ./Dockerfile
depends_on:
- "php"
env_file:
*env
expose:
- "9000"
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes
# postgres - database
postgres:
build:
context: ./.docker-config/postgres
dockerfile: ./Dockerfile
env_file:
*env
environment:
POSTGRES_DATABASES: "project"
POSTGRES_USER: project
POSTGRES_PASSWORD: project
init: true
ports:
- "5432:5432"
volumes:
- db-data:/usr/local/pgsql/data
- ./db-seed/:/docker-entrypoint-initdb.d
# queue - runs queue jobs via php craft queue/listen
queue:
build:
*php-build
command: /var/www/project/run_queue.sh
depends_on:
- "php"
env_file:
*env
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes
# redis - key/value database for caching & php sessions
redis:
build:
context: ./.docker-config/redis
dockerfile: ./Dockerfile
expose:
- "6379"
init: true
# vite - frontend build system
vite:
build:
context: ./.docker-config/node-dev-vite
dockerfile: ./Dockerfile
env_file:
*env
init: true
ports:
- "3000:3000"
tty: true
volumes:
- ./buildchain:/var/www/project/buildchain:cached
- ./buildchain/node_modules:/var/www/project/buildchain/node_modules:delegated
- ./cms/web:/var/www/project/cms/web:delegated
- ./src:/var/www/project/src:cached
- ./cms/templates:/var/www/project/cms/templates:cached
volumes:
db-data:
cpresources:
storage: