好物优选点击查看详情 京东购买

暂无内容

docker安装WordPress

wordpress两种安装方式

第一种
wordpress两种安装方式:第一种使用docker
1、安装docker、docker-compose

 sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine 
 yum -y update yum install -y yum-utils yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sudo yum makecache fast sudo yum install docker-ce docker-ce-cli containerd.io -y sudo systemctl start docker sudo systemctl enable docker sudo systemctl status docker 

重要参考链接 https://docs.docker.com/compose/install/

   wget -O /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 //上面wget这一步,如果下载速度慢,可以本地下载后,手动上传docker-compose,到/usr/local/bin/目录下 mv ./docker-compose-Linux-x86_64 docker-compose cp ./docker-compose /usr/local/bin/ sudo chmod +x /usr/local/bin/docker-compose sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose docker-compose --version 

2、https://docs.docker.com/samples/wordpress/

mkdir -p /root/my_wordpress cd /root/my_wordpress/ vim docker-compose.yml 添加如下内容: version: "3.9" services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest volumes: - wordpress_data:/var/www/html 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: {} wordpress_data: {} 

3、启动项目

docker-compose up -d 

4、访问地址
http://localhost:8000

第二种方式 —> 作为了解,忽略
1、安装docker、docker-compose 同上
2、https://hub.docker.com/_/wordpress

wordpress的插件与主题地址,下载下来上传即可
https://wordpress.org/themes/

3、启动方式与命令相同
docker-compose -f docker-compose.wordpress.yml up -d #后台运行
docker-compose -f docker-compose.wordpress.yml down #停止并删除服务

参考链接地址
https://zhuanlan.zhihu.com/p/93832797

原文链接:https://blog.csdn.net/zhiboqingyun/article/details/121000031

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