Simple WordPress development setup.

One configuration file, and two commands, – let docker-compose.yml contain:

version: '2'
services:
  mariadb:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: XXXXXX
    volumes:
      - ./mariadb:/var/lib/mysql
  wordpress:
    image: wordpress
    ports:
      - 3002:80
    environment:
      WORDPRESS_DB_PASSWORD: XXXXXX
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_HOST: mariadb
    volumes:
      - ./www:/var/www/html

And then run these two commands:

docker-compose up
npx browser-sync start --proxy "localhost:3002" --files www/**

Voila, development wordpress installation, with automatic reload 🙂

Just create your development repository in www/wp-content/plugins/, make a symlink to it for easy access, and start coding…