Hello there, and welcome to the first post of the “WordPress Dockerized setup”.
Before starting to discuss the setup let’s quickly go over how I came to the decision of creating this automated setup.
Motivation
These days I am trying to shift all my local development setup to docker. I really like virtual environment-based development for certain reasons, which can be discussed in a separate topic.
So, as currently I am working as a WordPress engineer at rtCamp, therefore I have to create and maintain multiple WordPress sites locally.
So, here I found this tool called Lando which is a really great bootstrapping tool for docker-based setups. It serves as a great solution for both of my above requirements i.e dockerized setup for maintaining multiple sites. You can read more about using Lando for managing WordPress sites in detail here.
For creating a site with Lando we have to first write a .lando.config
file where we can put our custom configurations. Creating the configuration and all the configurations every time is really a tedious task. And here comes the idea of creating an automated script for creating the configuration based on the arguments supplied in the command and then run the Lando bootstrap script to get the WordPress site up and running.🚀
Product
Before using this setup be sure you have the following things installed (External dependencies):
Docker
Lando
Git
WordPress
Let’s start with how to do a one-time setup before using it.
Clone this repo in the folder ~/wordpress/
with the name wordpress.setup-DO-NOT-DELETE
using the command:
git clone https://github.com/Souptik2001/wordpress.setup.git ~/wordpress/wordpress.setup-DO-NOT-DELETE
( The name used here wordpress.setup-DO-NOT-DELETE
is important because that name is used in the Lando config file ).
And that’s it you are ready to create your first site with just one command:
- Just make sure you have cloned the
wordpress.setup
repo in~/wordpress/wordpress.setup-DO-NOT-DELETE
. - And now there inside there you will find a script named
setup.sh
. - Just run the script as so –
setup.sh app_name /path/where/the/proj/should/be/created wp-content_repo_url(optional)
. - If you don’t provide the
wp_content_repo_url
then a defaultwp_content
will be used which will contain the default theme and minimum plugins. - And your app is ready!
Go ahead and give it a try and one of the main benefits you will get from it I assure is that you will save a lot of disk space by avoiding downloading the WordPress core multiple times.
If you find some bugs then please raise an issue and then even contribute to the project✨.
Upcoming features📋
There are a lot of useful features that I have planned to release at the end of October🤞. Here’s a sneak peek-
- Choice of WordPress and PHP version.
- Create a multisite with the option to select between subdirectory or subdomain setup.
- Create sites with VIP template.
How was the blog?