「WordPress」- 安装与升级

  CREATED BY JENKINSBOT

通过 Docker Compose 部署

Quickstart: Compose and WordPress | Docker Documentation

我们通过 Docker Compose 部署 WordPress 的原因是为了站点的便捷迁移,鉴于如下原因:
1)配置及数据”集中“存储,在迁移站点时,能够快速完成迁移;
2)在迁移站点时,新主机仅需 Docker 服务;而传统的部署方式,需要预先搭建运行环境;

version: "3.9"
    
services:
  db:
    image: mysql:5.7
    volumes:
      - ./data-mysql:/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:
      - ./data-wordpress:/var/www/html
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress

章节列表

「WordPress」- 升级 5.1.8 到 5.6 版本