标签:lease nginx代理 生成 mysql nload emctl database tar pass
deploy :yum install docker
systemctl start docker
systemctl enable docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose -v
docker-compose version 1.23.2, build 1110ad01
存放web-sql和Wordpress数据 (文件夹名称推荐按照站点域名一致)
mkdir -p /wordpress/
vi docker-compose.yml
version: ‘3.3‘
services:
db:
image: mysql:5.7
volumes:
- /wordpress/db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress-root
MYSQL_DATABASE: wordpress-db
MYSQL_USER: wordpress-user
MYSQL_PASSWORD: wordpress-user-ps
wordpress:
depends_on:
- db
image: wordpress:latest
volumes:
- /wordpress/wordpress_data:/var/www/html
ports:
- "80:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress-user
WORDPRESS_DB_PASSWORD: wordpress-user-ps
WORDPRESS_DB_NAME: wordpress-db
如果使用nginx做代理访问wordpress,修改docker 端口映射信息,将80端口让出即可:
ports:
- "8080:80"
cd /wordpress/
docker-compose up -d
docker-compose ps
or
docker ps
## 初始化站点
由于wordpress初始化过程会根据访问站点地址初始化数库信息,推荐首次初始化站点使用正式域名访问,没有进行dns解析的,可以先写host文件。
docker-compose 快速启动wordpress服务
标签:lease nginx代理 生成 mysql nload emctl database tar pass
原文地址:https://blog.51cto.com/michaelkang/2362202