traefik-ify
traefik-ify copied to clipboard
Drop-in, zero-fuss, lightning-fast development environment for Roots/Bedrock.
Traefik-ify
Easily add Traefik and Docker support to your roots/bedrock project. It's great! It's super easy to do! Nothing to lose (except some port conflicts!)
And it's basically non-destructive for an existing Trellis setup. Dank.
My Docker VMs now start up in less than ten seconds. They take up a fraction of the harddrive space. They use a completely negligible amount of RAM.
Requirements
- Docker
- Docker-compose
Try it out
The following assumes you are running Bedrock in a local environment.
Run the following commands from the traefik directory:
docker network create traefikifydocker-compose up -d
Run the following commands from the example.com directory:
composer installmv env.example .envdocker-compose up -d
You will then need to add example.test to /etc/hosts, or however you manage your virtual hosts.
The WordPress installation screen should be available at example.test. Additionally, you can monitor traefik at localhost.
Add to existing install
The mixins directory contains everything you need. You should be able to more-or-less just drop those files in and get to work, but read on:
- Copy
./config/docker/to yourconfigdirectory. - Copy
./Dockerfileto bedrock root. - Copy
./docker-compose.ymlto bedrock root. - Add
databaseto your.gitignore🙀 - Make sure the variables in the traefik-ify
env.exampleare included in your existing.env. It should look something like this:
WP_ENV=development
DOMAIN_CURRENT_SITE=example.test
WP_HOME=http://example.test
WP_SITEURL=http://example.test/wp
DB_NAME=example_test_development
DB_USER=example_test
DB_PASSWORD=example_test
Party
You should be good to execute docker-compose up from traefik, then your Bedrock root. You'll notice the database mounts to a directory in Bedrock. You can change this behavior (and lots of other things) in docker-compose.yml.