The Holy Grail WordPress project template for Heroku deployment and local Docker development.
Video Tutorial available on YouTube
- Bedrock-like modern development environment
- Deployment to Heroku pipelines
- Local Heroku-like environment with Docker-compose
- PHP 7
- WP-CLI
- Configurable Nginx
- Redis Object Cache
- Travis CI pipeline you can run with Docker
- PHP Codesniffer with nicer coding standards for WordPress
- Media Uploads to S3
- Newrelic APM monitoring
- Papertrail log management
- Environment management for complete
local
,development
,qa
andproduction
pipeline - CloudFormation script for provisioning a MariaDB RDS instance and an S3 bucket on AWS
- Scripts for automating deployment, synchronising databases
- Basic integration tests
Install Docker
Clone this repo and source set up your environment inside the project root.
cp .env.sample .env
source .env
I also recommend installing autoenv, so you don't have to run the source command all the time.
Start a shell inside Docker. It might take a moment for the images to download and build. This is normal.
docker-compose run shell
Now you can run composer install
inside Docker
composer install
Outside the docker shell, you can now start the main process
docker-compose up web
You can now navigate to http://localhost:8080
to
start working with your local WordPress installation.
Use the included CloudFormation script to provision a MariaDB instance and an S3 bucket for uploads on AWS.
The script will output the values needed for Heroku config variables:
Set up a new app on Heroku for your WordPress project. Use the values generated by the Cloudformation script previously
This is how your project should look like on Heroku:
Here's an example of a WordPress instance running on Heroku:
You can run WP-CLI locally by starting the shell container
docker-compose run shell
To run wp-cli in a Heroku instance, just run a temporary bash dyno.
heroku run bash
Both environments have WP-CLI available as wp
.
Travis CI will run the ci
container to test your app. You can do the same
locally:
docker-compose up ci