WordPress-5.5

Introduction

This image is suitable for deploying wordpress-5.5 managed by supervisord. Supervisor jobs conf files can be kept int he supervisor folder, in the root of the project.

Stack Code

wordpress-5.5 - To be mentioned in build.image_template in appz.yml.

Pre-requisites

Make sure both Vault and MariaDB-Master applications are deployed before deploying WordPress.

Sample Project

WordPress

Sample AppZ YAML

Name: appz.yml. To be placed in the root of your git repo.

app:
    name: Wordpress
    code: WORDPRESS
    notify: appz@ecloudcontrol.com

build:
    version: 5.5
    env: DEV
    build_file: none
    output_files: output/*.zip
    image_template: wordpress-5.5

deploy:
    context: appz/DEV
    type:  statefulset
    replicas: 1
    port:
    - 443

volumes:
  - claim: wordpress-5-5-data-dev
    mount: /var/www/html/wp-content/uploads
    name: data
    size: 5Gi
  - claim: wordpress-backup
    mount: /appz/backup
    name: backup
    size: 5Gi

properties:
ENABLE_HA: "no"  
  #if HA is disabled
  MYSQL_HOST : "mariadb-master-10-4:3306"
  #if HA is enabled
  #MYSQL_MASTER_HOST : "mariadb-master-10-4:3306"
  #MYSQL_SLAVE_HOST : "mariadb-slave-10-4:3306"
  MYSQL_USER: wordpress
  MYSQL_DATABASE: wordpress
  ADMIN_USER: wpadmin
  ADMIN_EMAIL: appzdev@cloudbourne.co
  SITE_TITLE: "Wordpress AppZ Workshop Demo"
  MYSQL_PASSWORD:
     vault: MYSQL_PASSWORD_KEY
  #Generate hash at https://ehikioya.com/wordpress-password-hash-generator/
  ADMIN_PASSWORD_HASH: $P$BAeYgHEtHyCT335q2Iya9JL4CtKHc1/
  revision : 82

Sample Contents YAML

We are passing the themes and plugins details through the contents.yml, similar to the appz.yml. There are two sections in the contents.yml file: theme and plugins. This will download the theme from the 'urlgiven under thethemesection and save it as thenamerefers. Also, all the plugins will be downloaded from the urls given under thepluginssection. A samplecontents.yml` is given below.

Name: contents.yml.

---
theme:
   name: Avada                                # Name of the theme - 'Avada' used here.
   url: https://www.example.com/wp-content/uploads/2018/01/themeforest-eAydLluh-avada-responsive-multipurpose-theme-wordpress-theme-6.2.3.zip
                                              # URL for 'Avada' theme download

plugins:                                      # WordPress uses plugins to add new features and functionalities, below ones are the plugins used here.

   - https://www.example.com/wp-content/uploads/2018/01/fusion-core-4.2.3.zip
   - https://www.example.com/wp-content/uploads/2018/01/fusion-builder-2.2.3.zip
   - https://www.example.com/wp-content/uploads/2018/01/revslider-5.4.8.3.zip
   - https://downloads.wordpress.org/plugin/contact-form-7.5.2.zip
   - https://downloads.wordpress.org/plugin/query-monitor.3.6.1.zip
   - https://downloads.wordpress.org/plugin/tuxedo-big-file-uploads.1.2.zip

Properties

The image is vault enabled so secrets can be pulled from vault. These are placed under properties in appz.yml. Please check each one below, with its actual purpose.

  • MYSQL_HOST - MariaDB database server host linked to WordPress.
  • MYSQL_USER - The user 'wordpress' in the Mariadb server.
  • MYSQL_DATABASE - The database' wordpress' in the Mariadb server.
  • MYSQL_PASSWORD - Password of the Mariadb user 'root'.
  • ADMIN_USER - Name of the WordPress admin user.
  • ADMIN_PASSWORD_HASH - Password of the WordPress admin user in hash.
  • SITE_TITLE - Title in the wordpress site.

Volumes

  • /var/www/html/wp-content/uploads - WordPress data folder - Mandatory

  • /appz/backup - Backup of WordPress data

Standard AppZ Volumes are enabled.