This project demonstrates a containerized WordPress infrastructure using Docker Compose.
It simulates a small high availability WordPress hosting environment with multiple application nodes and an NGINX load balancer.
The stack includes:
• NGINX reverse proxy and load balancer
• two WordPress application containers
• MySQL database container
• persistent storage using Docker volumes
The goal of the project is to practice infrastructure setup, container orchestration, and troubleshooting typical WordPress hosting issues.
Client
↓
NGINX Load Balancer
↓
WordPress Container 1
WordPress Container 2
↓
MySQL Database
NGINX distributes traffic across the WordPress containers while both instances share the same MySQL database.
Linux
Docker
Docker Compose
NGINX
WordPress
MySQL
Acts as a reverse proxy and load balancer.
Responsibilities:
• distributes requests between WordPress containers
• routes HTTP traffic to backend services
• simulates load balancing used in real hosting environments
Two WordPress instances simulate horizontal scaling.
Responsibilities:
• serve the WordPress application
• connect to the shared MySQL database
• handle incoming requests forwarded by NGINX
Stores WordPress application data including:
• posts
• users
• configuration
• plugins and metadata
Database persistence is implemented using Docker volumes.
wordpress_data
Stores WordPress files and persistent data.
db_data
Stores MySQL database data to prevent data loss when containers restart.
WordPress containers depend on the MySQL database service.
NGINX depends on the WordPress containers to route incoming requests correctly.
Docker Compose manages the startup order and networking between services.