Autostart a global traefik reverse proxy
This repository contains all configs needed to auto-start a global traefik instance as a reverse-proxy in a docker-compose setup.
The use case is described in my blog post: https://hollo.me/devops/routing-to-multiple-docker-compose-development-setups-with-traefik.html
- Clone this repository to
- Create the external docker network "gateway"
docker network create \ --driver=bridge \ --attachable \ --internal=false \ gateway
- Create the needed SSL-Certificates using mkcert:
and change the config of certificates in the certificates.toml, so that only your needed certificates are listed.
127.0.0.1 subdomain1.example.com subdomain2.example.com ...to your
/etc/hostsfile, so that the trafiic is routed to the traefik instance.
cp ~/traefik/com.user.traefik.autostart.plist ~/Library/LaunchAgents/com.user.traefik.autostart.plist
- Load the service with
launchctl load ~/Library/LaunchAgents/com.user.traefik.autostart.plist
- Check the log file for errors:
tail -F ~/Library/Logs/traefik.autostart.log
- Visit http://127.0.0.1:8080/dashboard/#/ - You should see your traefik dashboard.
If you're not my future self, adapt the paths to the user's home directory in the configs before running anything.