-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yaml
95 lines (89 loc) · 1.95 KB
/
docker-compose.yaml
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
version: '3.8'
services:
php:
image: miniphper/aliyun-php:latest
container_name: php7.4.3
environment:
- TZ=Asia/Shanghai # 设置时区
volumes:
- ./php/conf.d:/usr/local/etc/php/conf.d
- ./php/php-fpm.d:/usr/local/etc/php-fpm.d
- ./php/php-fpm.conf:/usr/local/etc/php-fpm.conf
- ./nginx/html:/usr/share/nginx/html
links:
- "mysql"
- "redis"
working_dir: /usr/share/nginx/html
networks:
- backend
nginx:
container_name: "nginx"
image: nginx:latest
ports:
- "80:80"
- "443:443"
environment:
- TZ=Asia/Shanghai
depends_on:
- "php"
- "golang"
links:
- "php"
- "golang"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/cert:/etc/nginx/cert
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/log:/var/log/nginx
- ./nginx/html:/usr/share/nginx/html
networks:
backend:
mysql:
container_name: "mysql"
image: mysql:latest
ports:
- "3306:3306"
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/conf.d:/etc/mysql/conf.d
- ./mysql/logs:/data/mysql/logs
restart: always
environment:
- TZ=Asia/Shanghai
- MYSQL_ROOT_PASSWORD=123456
networks:
- backend
redis:
container_name: redis
image: redis:6.0.2
restart: always
ports:
- "6379:6379"
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
- ./redis/data:/data
environment:
- TZ=Asia/Shanghai
networks:
- backend
golang:
image: golang:1.18.1
container_name: golang
environment:
- TZ=Asia/Shanghai # 设置时区
- GOPROXY=https://goproxy.cn,direct
volumes:
- ./nginx/html/golang:/golang
links:
- "mysql"
- "redis"
working_dir: /golang
command:
- ./web
ports:
- "8989:8989"
networks:
- backend
networks:
backend:
driver: bridge