-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
96 lines (87 loc) · 2.01 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
version: "3.9"
services:
### PHP-FPM Container #######################################
php:
build:
context: ./php
dockerfile: Dockerfile
container_name: php
depends_on:
- mysql
- redis
restart: unless-stopped
tty: true
working_dir: /var/www
volumes:
- ./wwwroot:/var/www
- ./php/additional.ini:/usr/local/etc/php/conf.d/additional.ini
networks:
- app-network
### Nginx Server Container ##################################
nginx:
image: nginx:stable-alpine
container_name: nginx
depends_on:
- php
restart: unless-stopped
tty: true
ports:
- "80:80"
- "443:443"
- "8000:8000"
- "8080:8080"
# Add the port for Xdebug here
- "9001:9001"
environment:
MYSQL_ROOT_PASSWORD: 12345678
TZ: Asia/Shanghai
volumes:
- ./wwwroot:/var/www
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/log:/var/log/nginx
networks:
- app-network
### MySQL Container #########################################
mysql:
image: mysql/mysql-server:latest-aarch64
container_name: mysql
tty: true
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: 12345678
TZ: Asia/Shanghai
volumes:
- mysqldata:/var/lib/mysql
- ./mysql/my.cnf:/etc/mysql/my.cnf
restart: always
networks:
- app-network
### Redis Container #########################################
redis:
image: redis:alpine
container_name: redis
ports:
- "6379:6379"
environment:
MYSQL_ROOT_PASSWORD: 12345678
TZ: Asia/Shanghai
volumes:
- redisdata:/data
- ./redis/conf:/usr/local/etc/redis
- ./redis/log:/log
# 指定配置文件启动redis
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
restart: always
networks:
- app-network
#Docker Networks
networks:
app-network:
driver: bridge
#Volumes
volumes:
mysqldata:
driver: local
redisdata:
driver: local