docker-compose 搭建wordpress(高效,方便!!!)

在这里插入图片描述
version: ‘3’
services:
db:
image: mysql:5.7
volumes:
– db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 123
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
wordpress:
depends_on:
– db
image: wordpress:latest
ports:
– 8000:80
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}

端口写的多少,浏览器上就写多少,像我这里是8000 在这里插入图片描述

感谢观看!

原文链接:https://blog.csdn.net/weixin_50663202/article/details/108939508?ops_request_misc=&request_id=d03d454821fa40db84ee36359e962fbd&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~koosearch~default-22-108939508-null-null.268%5Ev1%5Econtrol&utm_term=docker%E3%80%81wordpress%E3%80%81wordpress%E5%BB%BA%E7%AB%99%E3%80%81wordpress%E4%B8%BB%E9%A2%98%E3%80%81%E5%AE%B9%E5%99%A8%E9%95%9C%E5%83%8F%E3%80%81

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享