-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
73 lines (68 loc) · 1.63 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
version: "3"
services:
my_site:
build:
context: .
dockerfile: etc/Dockerfile
image: registry.cn-beijing.aliyuncs.com/yxf-blog/my_site:1.0.0
container_name: my_site
restart: always
volumes:
- ./logs:/app/logs
# - .:/app
expose:
- "9000"
sysctls:
- net.core.somaxconn=100
environment:
- TZ=Asia/Shanghai
- MYSQL_HOST=mysql
- MYSQL_DATABASE=my_site
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- REDIS_HOST=redis
- REDIS_PORT=${REDIS_PORT}
depends_on:
- mysql
- redis
mysql:
image: registry.cn-beijing.aliyuncs.com/zeroco2/mysql:8.0.26
command: --default-authentication-plugin=mysql_native_password
container_name: mysql
restart: always
ports:
- "3309:3306"
volumes:
- db_volume:/var/lib/mysql
environment:
- TZ=Asia/Shanghai
- MYSQL_DATABASE=my_site
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
redis:
restart: always
image: registry.cn-beijing.aliyuncs.com/zeroco2/redis:7.4.2
ports:
- "6380:6379"
volumes:
- redis_data:/data
nginx:
restart: always
container_name: nginx
image: registry.cn-beijing.aliyuncs.com/zeroco2/nginx:1.25
ports:
- "9000:9000"
- "80:80"
- "443:443"
volumes:
- ./blog.conf:/etc/nginx/conf.d/blog.conf
- ./cert:/etc/nginx/cert
depends_on:
- my_site
volumes:
db_volume:
driver: local
redis_data:
driver: local