![wordpress-admin.png wordpress-admin.png](https://lyvba.com/wp-content/uploads/2021/05/1477476693.png)
一键 WordPress 博客安装脚本
curl -L git.io/lnmp.sh | bash
# 国内用户使用镜像
curl -L lyvba.com/lnmp.sh | bash
建立网站和数据库目录和下载wordpress程序设置目录权限
mkdir -p /data/www/ /data/mysql
cd /data/www
curl https://cn.wordpress.org/latest-zh_CN.tar.gz | tar -zx
chown -R www-data:www-data /data/www/wordpress
安装 docker-compose 部署工具,部署lnmp
apt install -y docker-compose
wget docker-compose.yml
docker-compose up -d
设置 wordpress 网页程序
数据库名: wordpress
用户名: root
密 码: WordPress@2021
数据库主机: db
![wordpress_set.png wordpress_set.png](https://lyvba.com/wp-content/uploads/2021/05/3919680989.png)
附: docker-compose.yml 文件内容
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- /data/mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: wordpress
MYSQL_ROOT_PASSWORD: WordPress@2021
adminer:
image: adminer
restart: always
ports:
- 10086:8080
wordpress:
image: hongwenjun/nginx-php
container_name: wordpress
restart: always
volumes:
- /data/www/wordpress:/var/www/html
ports:
- 80:80
- 443:443
0 条评论