代码拉取完成,页面将自动刷新
#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:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。