Spinning Up a WordPress Site with Docker 🛠️📦

Now that Nginx is up and running — complete with Let’s Encrypt for auto-magical HTTPS — it’s time to add something fun behind it:
my own WordPress site.
I figured, why not host my own little corner of the web? It’s easy with Docker, and honestly… if you’ve come this far, you’re practically a dev already 😎.
Here’s the docker-compose.yml
I used to get it all going:
version: '3.3'
services:
db:
container_name: 'virtruvius-db'
image: 'mariadb'
volumes:
- './data/mysql:/var/lib/mysql'
ports:
- 18778:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: virtruvius_db
MYSQL_USER: wordpress_user
MYSQL_PASSWORD: xxxxxxxx
wordpress:
container_name: 'virtruvius-wp'
depends_on:
- db
image: 'wordpress:latest'
ports:
- '8099:80'
environment:
WORDPRESS_DB_HOST: 'virtruvius-db:3306'
WORDPRESS_DB_USER: wordpress_user
WORDPRESS_DB_PASSWORD: xxxxxxx
WORDPRESS_DB_NAME: virtruvius_db
VIRTUAL_HOST: www.domein.nl,domein.nl
LETSENCRYPT_HOST: www.domein.nl,domein.nl
LETSENCRYPT_EMAIL: admin@domein.nl
volumes:
- "./wordpress:/var/www/html"
- "./plugins:/var/www/html/wp-content/plugins"
networks:
default:
external:
name: dockerwp
A few notes:
- The database is a MariaDB container, running on an external port (18778) in case I ever need to poke at it from the outside.
- WordPress connects to the DB container directly via its service name (
virtruvius-db:3306
). - And most importantly: with the
VIRTUAL_HOST
andLETSENCRYPT_*
environment variables, it slides right into the Nginx reverse proxy setup I built earlier — complete with HTTPS thanks to our buddy Let’s Encrypt.
Once deployed, I pointed my domain (say, domein.nl
) to my Pi’s IP address, and… it just worked.
Kind of wild seeing a full WordPress site running from that tiny little board on my desk.
Next steps? Probably play with some custom themes, optimize performance, and make sure backups are in place.
But for now — we’re live, baby. 🥳