I discovered a new WordPress local dev-env

wordpress docker wodby

Opening

From time to time I have to build WordPress pages. WordPress is not bad. It's actually good, but I use Docker for development and the official docker images are not great.

I actually managed my own PHP WordPress images about 2 years ago, but they are now deprecated (PHP 7.0 and PHP 7.1) and I don't have time or strength to manage them again.

Let's search for some ready-made solution!

Wodby

Wodby logo

Managed stacks and infrastructure for post-container world -- that's their marketing claim.

And not only that. These guys provide us with local development stacks with everything I missed from the official WordPress image. For example:

  • UID/GID out of the box
  • xDebug
  • tooling for wp-cli
  • tooling for composer

And much more. Just check their guide for WordPress: https://wodby.com/docs/stacks/wordpress/local/ -- it's very easy to follow and start developing in WordPress.

Are you interested in Drupal, PHP, Ruby or Python? They have them too.

And bonus? You can use their deployment stack as a developer for free! Great for showing your work to your clients ;-)

Installation

The installation process is pretty clear, here are just a few adjustments I made.

  1. Do not clone/fork wodby/wordpress-composer but just run composer create-project wodby/wordpress-composer some-dir --stability dev --no-interaction as written in the repository README.md
  2. I changed $PROJECT_BASE_URL to just $PROJECT_NAME.local -- this is shorter :-)
  3. I uncommented mounted volumes for MariaDB, because persistent data are better (you can mount it with just - ./database:/var/lib/mysql)
  4. If you have an issue with MariaDB not starting, just try another MariaDB tag in your .env
  5. You don't need to manually change wp-config.php. Just point your browser to WordPress and let the installer do everything for you
  6. Uncomment the Adminer section in docker-compose.yml -- just my personal preference
  7. Uncomment NGINX_SERVER_ROOT for Nginx and add /web to the end
  8. Run make up
  9. Profit

Closing

This took me more time than I expected for the first run. But now I'm very happy with the dev environment. I have prepared my own template for future projects and I hope I will only need to update dependencies going forward.

Thanks, guys from Wodby!

Previous Post Next Post

Related Posts