Traefik
Setting up a local dev environment with Traefik as the proxy has some benefits:
- highly configurable
- only need to expose required ports on the Traefik container
- simplifies configuring SSL certificates and redirects for each dev site.
Given the benefits, I found it worth while investing the time and effort in learning enough about Traefik to apply those benefits to new projects as it simplifies config for each new project.
I had done the same when I was running Docker on a regular Fedora workstation system and needed to have it replicated with podman containers in Fedora Silverblue system. Setup seemed simpler when using docker containers, as Traefik has built in auto-discovery available via container labels. Podman containers need to be handled differently though.
Local dev env with Podman and Traefik⌗
As usual, an ansible-playbook
is used to configure required containers:
The Traefik dashboard will be available on http://localhost:8080
For each local dev site that you want to incorporate with Traefik, add a dynamic config file as follows:
http://project1-web will be redirected to use https and the ssl certificate provided by Traefik or preferrably create your own using a tool like mkcert
for example.
I’ll write up more about using mkcert for this purpose in a later post.