WordPress customization and plugin development is a common task we perform in our custom software development services. A typical WordPress development workflow starts with setting up development environment to uploading the bug-free code to the live website.
The WordPress environment that we setup, can vary with each project requirement. The version, features, plugins, web applications, content, etc. would change depending on the business.
Here, we’ll see what causes WordPress project delays and how we speed up project workflow using WordPress Docker containers.
See how we build software customized for you
What causes delay in WordPress workflow?
As business grows, the WordPress sites may require more features or customization. But directly modifying the code in the live WordPress website is a suicidal attempt, as the bugs or compatibility errors can break the site.
That’s why most developers use a development environment to do the coding and perform proper testing of the code before deploying it to the live site. This development environment must be identical to the live server, to avoid bugs.
In many cases, there may be multiple developers working on the same website development, and therefore multiple development environments are required, which can incur time delays in setting up.
To reduce the project delays incurred due to the time wasted in manually setting up the development environment each time, we make use of Docker containers.
[ Use your time to build your business. We’ll take care of your software needs. Hire our WordPress experts to get unique features and plugins for your site . ]
How WordPress Docker containers help reduce project delay
Docker containers are packaged instances which contain both the software and a complete filesystem and applications required for that software to work.
By making use of custom images, we simulate Docker containers to create development environments that are the exact replica of the server environment. They contain the code, run-time, applications, system libraries, etc.
As a result, developers need not wait for the administrators to spin up a new server instance and install all the required applications in it, which is a time consuming process.
Thus, the WordPress projects get accelerated using Docker, by reducing environment setup time from hours and days to seconds or minutes.
How to setup WordPress environment with Docker
Docker uses images of applications to setup an environment. With Docker, WordPress environments can be easily setup in your machine. Today, we’ll discuss how we sped up our WordPress applications using Docker, with these simple commands:
1. First we installed the ‘docker‘ and ‘docker-compose‘ tools in our developer’s machine:
sudo apt-get install docker docker-compose
2. Developer then checks out the code from the live server SVN to his machine:
svn co --username docker-user http://svn.liveserver.net/usvn/svn/WP/trunk/mysite/ /project/mywpproject/
3. We have compiled a custom ‘Docker compose file’ which specifies the application versions for the WordPress install.
cat docker-compose.yml
wordpress:
image: bobdev.com/wordpress:4.5.2-php-5.5.2
links:
- wordpress_db:mysql
volumes:
- ./html:/var/www/html
ports:
- 8086:80
wordpress_db:
image: mysql:5.6.26
environment:
MYSQL_ROOT_PASSWORD: wprootpass
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- wordpress_db:mysql
ports:
- 8186:80
environment:
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: wprootpass
PMA_HOST: mysql
At Bobcares, we maintain an internal repository of images for different application versions and WordPress installs. These images are maintained secure and updated by our server management team.
Depending on the requirement of the project, the compose file is updated to specify the application or version. For instance, some projects may require MariaDB instead of MySQL as the database server.
[ You don’t have to lose your sleep over project delays. Our expert DevOps engineers are online 24/7/365 to help you speed up your projects. ]
4. We then churn out the exact WordPress environment in the developer’s machine, using this file, with the command ‘docker-compose up -d‘.
5. Now the WordPress environment from the live server is cloned to developer’s machine and he would be able to access it locally to make the customization needed.
The following is the snippet from a WordPress install with Apache, MySQL and PhpMyAdmin.
docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------
mywp_phpmyadmin_1 /run.sh phpmyadmin Up 0.0.0.0:8187->80/tcp
mywp_wordpress_1 /entrypoint.sh apache2-for ... Up 0.0.0.0:8086->80/tcp
mywp_wordpress_db_1 /entrypoint.sh mysqld Up 3306/tcp
Developer can now access the WordPress website from his machine by simply taking the URL in his browser.
In short..
Today we saw how we deployed WordPress application environments quickly with Docker. In addition, the database file may have to be imported to the local WordPress install via tools such as PhpMyAdmin.
The document root of the development site is mounted in the Docker container, so that any changes made by the developer locally would be updated automatically in the development environment.
Maintaining the image repository with the custom application images for all the relevant software and web services, is a vital task we do. These images are updated with the latest security patches and customized for various business requirements.
Bobcares DevOps engineers routinely help application developers configure their infrastructure and optimize their DevOps process. If you’d like to know how to speed up your WordPress projects, we’d be happy to talk to you.
Hello, yes I was facing the same issue of projects delays but after reading your blog about “Using WordPress Docker containers to prevent project delays” made me realize that WordPress Docker Container is really helpful. And I just started using this. Thank You So much for your information.
Janet,
Glad to know that our article could be of help to you.