A Docker Swarm cluster deployment for running WordPress using DNS name-based discovery.
- Five services running in a Docker Swarm cluster:
- A WordPress instance with labels for Traefik to load-balance
- A MariaDB database configured for Galera-based clustering using Swarm mode DNS for discovery
- A Traefik proxying and load balancing container
- A Redis instance for caching
- An Nginx instance
- Docker Engine 20.10.0 or later
- Docker Compose 1.29.0 or later
- Docker Swarm mode enabled
-
Clone the repository:
git clone https://github.com/yourusername/wordpress-swarm.git
-
cd wordpress-swarm
-
Deploy the WordPress stack:bash
docker stack deploy -c docker-compose.yml wordpress
-
Access the WordPress site: Open your browser and visit http://wordpress.example.com. Replace wordpress.example.com with your actual domain name.
To scale the WordPress service to 10 replicas, run the following command:
docker service scale wordpress_wordpress=10
Access the Traefik dashboard by visiting http://traefik.example.com. Replace traefik.example.com with your actual domain name.
To shut down and remove the WordPress stack, run the following command:
docker stack rm wordpress
Contributions are welcome! Please see the contribute.md file for more information.
- @thomasvincent(https://github.com/thomasvincent)
##License This project is licensed under the Apache 2.0 License. See the LICENSE file for more information.