generated from nystudio107/spin-up-craft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·87 lines (86 loc) · 2.26 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
version: '3.7'
services:
# nginx - web server
nginx:
build:
context: ./.docker-config/nginx
dockerfile: ./Dockerfile
depends_on:
- "php"
env_file: &env_file
- ./.env
environment: &env
DEV_SERVER_PORT: "${DEV_SERVER_PORT}"
CODESPACES: "${CODESPACES}"
CODESPACE_NAME: "${CODESPACE_NAME}"
GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: "${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
init: true
ports:
- "${DEV_SERVER_PORT}:80"
volumes:
- cpresources:/var/www/project/web/cpresources:delegated
- ./web:/var/www/project/web:cached
# php - run php-fpm
php:
build: &php-build
context: ./.docker-config/php
dockerfile: ./Dockerfile
depends_on:
- "mysql"
env_file:
*env_file
environment:
*env
expose:
- "9000"
init: true
stop_grace_period: "1s"
tty: true
volumes: &php-volumes
# Bind mount the entire project directory
- ./:/var/www/project:cached
# Directories we want to persist as volumes
- cpresources:/var/www/project/web/cpresources:delegated
- storage:/var/www/project/storage:delegated
# Specific directories that need to be bind mounted inside the volumes
- ./storage/logs:/var/www/project/storage/logs:delegated
- ./storage/runtime/compiled_templates:/var/www/project/storage/runtime/compiled_templates:delegated
- ./storage/runtime/compiled_classes:/var/www/project/storage/runtime/compiled_classes:delegated
# mysql - database
mysql:
build:
context: ./.docker-config/mysql
dockerfile: ./Dockerfile
cap_add:
- SYS_NICE # CAP_SYS_NICE
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: project
MYSQL_USER: project
MYSQL_PASSWORD: project
init: true
expose:
- "3306"
volumes:
- db-data:/var/lib/mysql
- ./db-seed:/docker-entrypoint-initdb.d
# queue - runs queue jobs via php craft queue/listen
queue:
build:
*php-build
command: /var/www/run_queue.sh
depends_on:
- "mysql"
env_file:
*env_file
environment:
*env
init: true
stop_grace_period: "1s"
tty: true
volumes:
*php-volumes
volumes:
db-data:
cpresources:
storage: