How to run WordPress + Docker | Containerized Development

How to run WordPress + Docker | Containerized Development

ยท

2 min read

As a developer probably you may have heard before about WordPress is a free and open-source blogging tool and a content management system (CMS) based on PHP and MySQL, which runs on a web hosting service. I was planning to install it using Docker for a containerized development environment, so I did researches and found a method to do it, but as I am using the recent Apple Macbook with an arm-based processor I found that due to lack of ARM support for MySQL I didn't find some developer-friendly method to get it started. So why not create one?!

If you want a quick start ๐Ÿƒ๐Ÿปโ€โ™‚๏ธ you can access my WordPress + Docker repository to check it out!

image.png

Advantages

I decided to create something that makes it easier to start and use for your development environment with will also benefit you during production. The docker-compose.yml file has these advantages:

โ˜๏ธ 1 command to start

๐Ÿ–ฅ Ready for production and local development

โšก Performance Optimized

๐ŸŽ Works anywhere (Includes support for Apple Silicon Macs)

๐Ÿ“š Ease of development and managing different versions

Stack

  • WordPress (Latest version)
  • MySQL (Latest Version)
  • Docker

How start using locally?

In your local environment you need to have installed:

  • Docker
  • Docker Compose

After cloning this repository, you can access the dev folder to be able to run the local dev environment using this command below.

git clone https://github.com/raihanameen/universal-wordpress.git
cd universal-wordpress
docker-compose up -d

Screenshot 2021-05-22 at 10.30.33 PM.png

๐ŸŽ‰ That's It! Now go to localhost/8080 to access the WordPress panel and get started with your projects.

Screenshot 2021-05-22 at 10.27.22 PM.png

Conclusion

Working in a Containerized Environment is an efficient way of developing applications, as it is completely isolated so that we can develop without worrying about breaking anything or having any system-specific issues which actually helps in developing larger applications that have a large team. So now no more "But It works on my machine"๐Ÿ˜‚

image.png

If you liked my blog please give it a ๐Ÿ‘๐Ÿป and consider subscribing for more informative content. And If you have any suggestions or questions please drop them down in the comments section, I'd be glad to hear from you.

You also can follow me on these platforms:

You can also support me by: Buy Me A Coffee

ย