Series: Drupal Docker
tl;dr: If you're managing several sites with developer environments, traefik can make your local experience better.
Series Description: This series details my development environment and CI/CD deployment pipeline. The first post in the series provides an overview and the code for the entire demonstration can be found in my GitLab. You can navigate other posts in the series using the list of links in the sidebar.
The code for this project is found in my Codeberg.
Why
This is used to make it easier to browse having multiple local Docker developer environments, providing two improvements:
- Direction to the correct service based only on the URL, not needing separate and unique ports for each project that you must remember and enter in your browser.
- A trusted certificate covering all projects, no longer needing to routinely approve self-signed certificates for each site every time a project is rebuilt plus occasionally in between. For this to work, each project must be using a local domain of the format *.dev.test.
How
The details for using this can be found in the README of the Codeberg project, but in short:
- Run the traefik services, including mkcert that creates a new certificate.
- Tell your computer to trust that certificate.
- In each project, use the *.dev.test domain pattern, set up traefik labels, and join the web container to the "proxy" network.
- Add the *.dev.test domain to your computer's hosts file.
Previous: AI in Coding Lightning Talk