加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
Aipplii 提交于 2023-11-02 16:50 . 第一次提交测试
#compose版本
version: "3"
services:
sangeng_blog:
#微服务镜像
image: qmblog:1.0
container_name: qmblog
ports:
- "8081:8081"
#数据卷
volumes:
- /root/app/qmblog:/data/qmblog
networks:
- blog_network
depends_on:
- redis
- mysql
- nginx
#redis服务
redis:
image: redis:6.0.8
ports:
- "6379:6379"
volumes:
- /root/pp/redis/redis.conf:/etc/redis/redis.conf
- /root/app/redis/data:/data
networks:
- blog_network
command: redis-server /etc/redis/redis.conf
#mysql服务
mysql:
image: mysql:8.0.19
environment:
MYSQL_ROOT_PASSWORD: 'abc123'
MYSQL_ALLOW_EMPTY_PASSWORD: 'no'
MYSQL_DATABASE: 'qm_blog'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'abc123'
ports:
- "3306:3306"
volumes:
- /root/app/mysql/db:/var/lib/mysql
- /root/app/mysql/conf/my.cnf:/etc/my.cnf
- /root/app/mysql/init:/docker-entrypoint-initdb.d
networks:
- blog_network
command: --default-authentication-plugin=mysql_native_password #解决外部无法访问
#nginx服务
nginx:
image: nginx:1.18.0
ports:
- "80:80"
- "8093:8093"
- "8094:8094"
volumes:
- /root/app/nginx/html:/usr/share/nginx/html
- /root/app/nginx/logs:/var/log/nginx
- /root/app/nginx/conf:/etc/nginx
networks:
- blog_network
#创建自定义网络
networks:
blog_network:
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化