-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
102 lines (95 loc) · 2.05 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
version: "3.5"
services:
setup:
container_name: twilight-setup
image: phpswoole/swoole:php8.2
command: [ "composer", "install" ]
working_dir: /var/www
volumes:
- .:/var/www
api1: &api
container_name: twilight-app1
image: phpswoole/swoole:php8.2
restart: unless-stopped
environment:
- APP_ENV=development
- AUTORELOAD_PROGRAMS=swoole
- AUTORELOAD_ANY_FILES=0
- CACHE_HOST=cache
- CACHE_PORT=6379
- DB_DSN=mysql:host=db;dbname=twilight
- DB_USER=root
- DB_PASSWORD=root
- LOG_MAX_SIZE=100000
- LOG_MAX_FILES=3
- LOG_LEVEL=Debug
# Debug
# Info
# Notice
# Warning
# Error
# Critical
# Alert
# Emergency
depends_on:
- cache
- db
working_dir: /var/www
volumes:
- .:/var/www
deploy:
resources:
limits:
cpus: "0.25"
memory: "500MB"
api2:
<<: *api
container_name: twilight-app2
nginx:
container_name: twilight-reverse-proxy
image: nginx
restart: unless-stopped
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.4"
memory: "500MB"
cache:
container_name: twilight-cache
image: redis:7
restart: unless-stopped
ports:
- '6379:6379'
deploy:
resources:
limits:
cpus: "0.1"
memory: "500MB"
db:
container_name: twilight-database
image: mysql:8.1
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=twilight
volumes:
# - ./docker/db/twilight.sql:/var/www/twilight.sql
- ./docker/db/twilight.sql:/docker-entrypoint-initdb.d/migrations.sql
- ./docker/db/.my.cnf:/root/.my.cnf
ports:
- "3306:3306"
deploy:
resources:
limits:
cpus: "0.5"
memory: "1000MB"
networks:
default:
name: twilight