I have demonstrated to use Ansible to deploy WordPress (https://tungle.ca/?p=1252). However, it is more efficient to use Docker compose to deploy WordPress.
+ Download the Latest Docker Version.
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
+ Change file permission & check docker version.
chmod +x /usr/local/bin/docker-compose
docker–compose --version
+ Create a sample docker-compose.yml file.
Use the following link as a reference to create the docker-compose file.
https://docs.docker.com/samples/wordpress/
Port forwarding the destination port 5547 on the docker node to port 80 on a docker container.
Limit 2GB memory for running WordPress.
![](https://tungle.ca/wp-content/uploads/2022/04/6.png)
+ Deploy WordPress by using Docker compose.
docker-compose up -d
![](https://tungle.ca/wp-content/uploads/2022/04/7-1024x652.png)
Check a TCP port 5547 is running on the docker node.
![](https://tungle.ca/wp-content/uploads/2022/04/9-1024x320.png)
Access to WordPress.
![](https://tungle.ca/wp-content/uploads/2022/04/1-1024x840.png)
![](https://tungle.ca/wp-content/uploads/2022/04/5-1024x576.png)