Docker-compose 安装 Wordpress 博客 安装 Wordpress 创建 docker-compose.wordpress.yml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 version:'3.3'services:db:image:mysql:5.7.22volumes:- db_data:/var/lib/mysqlrestart:alwaysenvironment:MYSQL_ROOT_PASSWORD:somewordpressMYSQL_DATABASE:wordpressMYSQL_USER:wordpressMYSQL_PASSWORD:wordpresswordpress:depends_on:- dbimage:wordpress:latestvolumes:- wordpress_data:/var/www/htmlports:- "8000:80"restart:alwaysenvironment:WORDPRESS_DB_HOST:db:3306WORDPRESS_DB_USER:wordpressWORDPRESS_DB_PASSWORD:wordpressWORDPRESS_DB_NAME:wordpressvolumes:db_data:{}wordpress_data:{} 启动 wordpress 1 > docker-compose -f docker-compose.wordpress.yml up -d 访问博客: localhost:8000 访问管理后台:l