docker-compose安装wordpress

NO.1
创建文件夹

输入以下命令

mkdir course

进入文件夹

cd course/

NO.2
创建配置文件

docker-compose.yml

nano docker-compose.yml

写入以下内容

version: '3.3'
services:
   db_course:
     image: mariadb:latest
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress
   wordpress_course:
     depends_on:
       - db_course
     image: wordpress:latest
     ports:
       - "9500:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db_course:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
volumes:
    db_data: {}

NO.3
启动docker

下载并启动服务

docker-compose up -d

NO.4
设置wordpress

启动成功后访问ip+端口

选择语言

设置账户

设置成功

点击登录

输入账户

进入仪表盘

选择插件

Eduma

设置概述,课节,教师描述等

END