环境准备
服务器系统 | Centos7.3 |
---|---|
内存 | 2G |
CPU | 2核 |
IP地址 | 10.0.0.41 |
#创建WordPress目录 mkdir wordpress #进入WordPress目录 cd wordpress/
#编辑docker-compose文件 vim docker-compose.yml
version: "3" services: mysql: image: mysql:5.6 ports: - "3306:3306" environment: - "MYSQL_ROOT_PASSWORD=123" - "MYSQL_PASSWORD=123" - "MYSQL_USER=tom" - "MYSQL_DATABASE=wordpress" wordpress: image: wordpress ports: - "80:80" environment: - "WORDPRESS_DB_NAME=wordpress" - "WORDPRESS_DB_USER=tom" - "WORDPRESS_DB_PASSWORD=123" - "WORDPRESS_DB_HOST=mysql"
#启动服务 docker-compose up -d
#查看服务的日志 docker-compose logs -f
访问WordPress测试页面
原文链接:https://blog.csdn.net/aaronszm/article/details/104698239?ops_request_misc=&request_id=3644b30f52c14f5aaeffe50e7c8950c8&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~koosearch~default-17-104698239-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
© 版权声明
声明📢本站内容均来自互联网,归原创作者所有,如有侵权必删除。
本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。
THE END