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
- Mariadb and
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:5.7.2 ports: - 80:80 environment: - "WORDPRESS_DB_USER=root" - "WORDPRESS_DB_PASSWORD=vFvpKjJ7HUbkD3wyLDp4" restart: always dns: 184.108.40.206 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
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.