Installation

I haven’t set up a new WordPress instance for quite some time. But lately I wanted to run WordPress on a Rasperry Pi. I used a docker compose file to run all services is one shot with

  • WordPress
  • Mariadb and
  • phpmyadmin.

Unfortunately the official mariadb image does not support ARM which is needed by the Raspberry Pi, so Im using jsurf/rpi-mariadb instead.

Here is the docker-compose.yml file:

version: '3.6'

services:
  wordpress:
    image: wordpress:latest
    ports:
      - 80:80
    environment:
      - "WORDPRESS_DB_USER=root"
      - "WORDPRESS_DB_PASSWORD=vFvpKjJ7HUbkD3wyLDp4"
    restart: always
    dns: 8.8.8.8
    volumes: 
      - /srv/wordpress:/var/www/html

  mysql:
    image: jsurf/rpi-mariadb
    volumes:
    - /srv/wordpress-mysql:/var/lib/mysql
    environment:
    - "MYSQL_ROOT_PASSWORD=vFvpKjJ7HUbkD3wyLDp4"
    - "MYSQL_DATABASE=wordpress"
    restart: always

  phpmyadmin:
    image: phpmyadmin:apache
    environment:
     - PMA_ARBITRARY=1
    restart: always
    ports:
     - 9999:80
    volumes:
     - /sessions

You start the solution with docker-compose up -d. Now you can set up WordPress by connecting to it with “http://your-hostname:80”

To access phpmyadmin on port 9999 you need to use

  • Server: mysql
  • User: root
  • Password: vFvpKjJ7HUbkD3wyLDp4

Upgrades

I am usually relying on the built-in mechanism of WordPress to upgrade the WordPress Release, the Plugins and the Themes, but I think it would be good practise to run a docker pull wordress to make sure that we get the latest version of the whole technology stack (e.g. PHP) after each major release upgrade.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.