This repository contains a WordPress setup using Composer for dependency management, Docker for local development, and Kubernetes for production deployment.
- Install required software:
That's it! No need for PHP or Composer locally - everything is handled via Docker.
- Clone the repository:
git clone [repository-url]
cd wordpress-composer-k8s- Create the required directory structure:
mkdir -p web/app/plugins
mkdir -p config/nginx- Start the local environment:
docker-compose -f docker-compose.override.yml up -d- Access WordPress at
http://localhost:8080
- The Dockerfile uses a multi-stage build:
- First stage uses the Composer image to install dependencies
- Second stage uses WordPress PHP-FPM image
- All PHP and Composer operations happen inside Docker containers
- No need to install PHP or Composer locally
- All dependencies are managed within Docker
- Ensure you have access to a Kubernetes cluster
- Deploy using Helm:
helm install wordpress ./helm/wordpress- Push your code to GitHub
- The GitHub Actions workflow will automatically:
- Build a Docker image
- Push to Docker Hub
- Deploy to your Kubernetes cluster
wordpress-composer-k8s/
├── Dockerfile
├── docker-compose.override.yml (voor local)
├── composer.json
├── composer.lock
├── config/
│ └── nginx/
├── .env.example
├── web/
│ └── app/
│ └── plugins/ (leeg, of met GF als zip install)
├── helm/
│ └── wordpress/
│ ├── Chart.yaml
│ ├── values.yaml
│ └── templates/
│ ├── deployment.yaml
│ ├── pvc.yaml
├── .github/
│ └── workflows/
│ └── deploy.yaml
- Docker and Docker Compose for local development
- Kubernetes cluster for production
- Helm for Kubernetes deployment
- GitHub account for automated deployments