-
Notifications
You must be signed in to change notification settings - Fork 148
/
docker-compose.yml
79 lines (74 loc) · 2.07 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
version: '2.1'
services:
# 内嵌 MySQL 服务,如果使用外部 MySQL,可以把这里的 mysql-service 删掉
mysql-service:
image: mysql:5.7.27
container_name: mysql-service
restart: always
networks:
- sg-network
volumes:
# 数据存储目录
- ./data/mysql-data:/var/lib/mysql
# MySQL 配置文件
- ./config-repo/mysql/conf/my.cnf:/etc/my.cnf
# SQL 初始化脚本
- ./config-repo/mysql:/docker-entrypoint-initdb.d
environment:
- "MYSQL_ROOT_PASSWORD=123456"
- "MYSQL_DATABASE=sg-exam-user"
- "TZ=Asia/Shanghai"
ports:
# 宿主机:容器
- "3306:3306"
# 内嵌 Redis 服务,如果使用外部 Redis,可以这这里的 redis-service 删掉
redis-service:
image: redis:latest
container_name: redis-service
restart: always
networks:
- sg-network
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
volumes:
- ./data/redis-data:/data
- ./config-repo/redis/redis.conf:/usr/local/etc/redis/redis.conf
# 内嵌 MinIO 服务,如果使用外部 Redis,可以这这里的 minio-service 删掉
minio-service:
image: minio/minio
container_name: minio-service
restart: always
networks:
- sg-network
command: server /data --address "0.0.0.0:9000" --console-address "0.0.0.0:9090"
ports:
- "9000:9000"
- "9090:9090"
environment:
- "MINIO_ACCESS_KEY=admin"
- "MINIO_SECRET_KEY=admin123456"
volumes:
- ./data/minio/data:/data
- ./data/minio/config:/root/.minio
sg-exam:
image: sg-exam:latest
restart: always
networks:
- sg-network
env_file: config-repo/sg-exam.env
ports:
- "80:80"
- "8080:8080"
volumes:
- ./config-repo/nginx/cert:/etc/nginx/cert/
- ./config-repo/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./logs/:/apps/data/web/working/logs/
depends_on:
- mysql-service
- redis-service
- minio-service
networks:
sg-network:
name: sg-network
driver: bridge