Skip to main content

WordPress

image-1581843277496.png

WordPress是使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。


 

version: '3'

services:

  wp:
    image: wordpress:latest
    volumes:
      - ./mnt/config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
      - ./mnt/wp-app:/var/www/html
      - ./mnt/wp-data:/var/www/html/wp-content
      - ./mnt/wp-data/config/wp-config.php:/var/www/html/wp-content/wp-config.php
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: <your_password_here>
    depends_on:
      - db
    links:
      - db

  pma:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      MYSQL_ROOT_PASSWORD: <your_password_here>
    links:
      - db:db

  db:
    image: mysql:latest # https://hub.docker.com/_/mysql/ - or mariadb https://hub.docker.com/_/mariadb
    command: [
        '--default_authentication_plugin=mysql_native_password',
        '--character-set-server=utf8mb4',
        '--collation-server=utf8mb4_unicode_ci'
    ]
    volumes:
      - ./mnt/wp-data:/docker-entrypoint-initdb.d
      - ./mnt/mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_ROOT_PASSWORD: <your_password_here>

volumes:
  db_data: