-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.local.yml
97 lines (90 loc) · 1.88 KB
/
docker-compose.local.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
version: '3.7'
# Docker Network
networks:
network:
driver: bridge
attachable: true
# Volumes
volumes:
mysql:
driver: local
redis:
driver: local
services:
# Apache + PHP
web:
build:
context: ../
dockerfile: build/Dockerfile
target: app
image: app-local
environment:
- CONTAINER_ROLE=app
- REDIS_HOST=redis
- REDIS_PORT=6379
env_file: ../.env
ports:
- "${HOST_PORT_HTTP:-80}:80"
- "${HOST_PORT_HTTPS:-443}:443"
depends_on:
- db
- redis
volumes:
- ../src:/var/www/html:delegated
networks:
- network
# Scheduler
scheduler:
image: app-local
user: webdev
environment:
- CONTAINER_ROLE=scheduler
- REDIS_HOST=redis
- REDIS_PORT=6379
env_file: ../.env
depends_on:
- web
volumes:
- ../src:/var/www/html:delegated
networks:
- network
# Queue worker
queue:
image: app-local
environment:
- CONTAINER_ROLE=queue
- REDIS_HOST=redis
- REDIS_PORT=6379
env_file: ../.env
depends_on:
- web
volumes:
- ../src:/var/www/html:delegated
networks:
- network
# MySQL
db:
image: mysql:8.0.23
command: [ "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password" ]
environment:
- TZ=${TZ}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_DATABASE}
env_file: ../.env
ports:
- "${HOST_PORT_DB:-3306}:3306"
volumes:
- mysql:/var/lib/mysql/
networks:
- network
# Redis
redis:
image: redis:6.2.4
command: [ "redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD}" ]
env_file: ../.env
ports:
- "${HOST_PORT_REDIS:-6379}:6379"
volumes:
- redis:/data
networks:
- network