1 Star 0 Fork 1K

yumile/sg-exam

forked from GuYiTan/sg-exam 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
GuYiTan 提交于 2024-06-09 16:23 . feat: 调整部署脚本
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/yumile/sg-exam.git
git@gitee.com:yumile/sg-exam.git
yumile
sg-exam
sg-exam
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385