{"id":22788973,"url":"https://github.com/ripeworks/wordpress-cluster","last_synced_at":"2025-10-25T16:16:12.157Z","repository":{"id":70208229,"uuid":"123960854","full_name":"ripeworks/wordpress-cluster","owner":"ripeworks","description":"Run a scalable, stateless cluster of Wordpress sites on AWS","archived":false,"fork":false,"pushed_at":"2024-02-28T14:57:25.000Z","size":32,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T03:32:05.914Z","etag":null,"topics":["aws","efs","kubernetes","lambda","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ripeworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-05T18:28:01.000Z","updated_at":"2023-12-11T15:16:24.000Z","dependencies_parsed_at":"2024-12-12T01:39:34.038Z","dependency_job_id":"c4c094e6-5dbb-4879-a171-94c4745e9f01","html_url":"https://github.com/ripeworks/wordpress-cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripeworks%2Fwordpress-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripeworks%2Fwordpress-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripeworks%2Fwordpress-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripeworks%2Fwordpress-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ripeworks","download_url":"https://codeload.github.com/ripeworks/wordpress-cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182752,"owners_count":21226117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","efs","kubernetes","lambda","wordpress"],"created_at":"2024-12-12T01:39:25.323Z","updated_at":"2025-10-25T16:16:12.096Z","avatar_url":"https://github.com/ripeworks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wordpress-cluster\n\nRun a scalable, stateless cluster of Wordpress sites on AWS\n\n## Initial Setup\n\n1. Create an EFS\n2. `ssh` into a new or existing instance (EC-2, Kubernetes node, etc) and mount the EFS.\n\n```\n$ sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport {EFS dns name}:/  /mnt/efs\n```\n\n3. Use SFTP or wp-cli to set up your wordpress websites inside of the EFS.\n4. Create a MySQL compatible database and set up your database(s). (RDS, PlanetScale, etc)\n\n## Lambda\n\nUse a php runtime layer on AWS Lambda to run Wordpress. Wordpress root is persisted through EFS.\n\n### Structure\n\n![](docs/infra-lambda.svg)\n\n#### Cloudfront\n\nThe entry point of any user request will be to a CloudFront distribution. The distribution origin points to the Lambda function URL. The website domain and certificate should CNAME to the distribution.\n\n#### Lambda\n\nThe serverless.yml should allow for easy deployment of a lambda function. Once the function is created, use the function's url to set up your CloudFront distribution.\n\nThe Lambda function uses a custom layer from the serverless PHP runtime, Bref.\n\n- [Bref Documentation](https://bref.sh/docs)\n- [Bref runtimes](https://runtimes.bref.sh/)\n\nAn EFS access point must be attached to the function, and for this your Lambda function will need to be in a VPC. Which also most likely means you will need a NAT Gateway in your VPC to access the internet.\n\n### Resources\n\n- [KotobaMedia/terraform-aws-wordpress-on-lambda-efs](https://github.com/KotobaMedia/terraform-aws-wordpress-on-lambda-efs)\n\nPretty much lifted the entire Lambda setup from this repo, thank you!\n\n## Kubernetes\n\nUse Kubernetes as a container platform to run tiny stateless instances of Wordpress. Each container uses EFS for file storage, and RDS for database storage.\n\n### Structure\n\nThis setup is intended for running multiple separate Wordpress websites. A lot of setups I see are for setting up a cluster for running only one website.\n\n![](docs/infra-kube.svg)\n\n#### Cloudfront\n\nThe entry point of any user request will be to a CloudFront distribution. The distribution should be tied to the main domain name using CNAMEs as well as have a valid SSL cert attached (ACM). For each different Wordpress you have, set up a distribution. All of the distributions will route to the single ELB instance. The traffic to the ELB is done over SSL, so make sure you have a certificate attached to your ELB, and that the cloudfront distributions point to that domain name.\n\n#### LoadBalancer\n\nThe Kubernetes cluster has one main LoadBalancer in the form of an ELB. Each request coming into the ELB will be passed to the individual nodes.\n\n#### Proxy\n\nAll requests from the ELB are sent into an nginx proxy deployment which will route the request to the appropriate Wordpress deployment usually based on the hostname of the request.\n\n#### Container\n\nEach Wordpress site is served by one or more containers. Each container is a basic Alpine linux image with php7, php-fpm, and nginx. The containers will volume mount to EFS at the specified location where its Wordpress root is.\n\n### Setup\n\n1. Setup your Kubernetes cluster using KOPS\n2. Ensure Wordpress sites are in your EFS. This repo uses `/wordpress/\u003cexample.com\u003e/` as its structure for each website.\n\n```\n/\n└── wordpress\n    └──  example.com\n         ├── logs\n         ├── sessions\n         ├── wordpress # Wordpress root\n         └── wp-config.php\n```\n\n**Note:** Containers will volume mount `/wordpress/mywebsite` from the EFS to `/app`\n\n5. Deploy `proxy-deployment.yml` to set up your nginx proxy and ELB.\n6. Set up each deployment using `wordpress-deployment.yml` as a template. Deploy as many for as many sites as you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripeworks%2Fwordpress-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fripeworks%2Fwordpress-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripeworks%2Fwordpress-cluster/lists"}