Docker-compose部署wordpress
跳到导航
跳到搜索
per
install Docker
Docker and docker-compose快速安装
下载版源码
p182 这个感觉比较有意思了
wordpres源码下载
https://cn.wordpress.org/download/ curl https://wordpress.org/latest.tar.gz | tar -xvzf -
一次性过的
mkdir Wordpress;cd wordpress vi docker-compose.yml version: "3" 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 ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress volumes: db_data: docker-compose up -d #运行
解说
开启一个 wordpress 服务和一个独立的 MySQL 实例 ports: - "8000:80" 容器的80端口暴露到机器的8000
http://192.168.88.51:8000/wp-admin/install.php