I'm currently running a NAS on my local network (on a address like http://192.168.4.184) with a couple of docker that I would like to put behind traefik. Since I'm using a dynamic configuration, I don't have a static config file for traefik.
Unfortunately, despite lots of research and troubleshoot, my dockers aren't reachable and I don't understand where the issue come from
For security (and to be easier to maintain), all my containers are split across several stacks and each one of them has a specific network
Your Traefik "static" config is in command, you need to define at least an entrypoint
When declaring a Docker network in compose, they are usually isolated from other compose "projects". Despite the same name, they are different networks.
So instead you need to declare a Docker network on CLI or declare in one compose (make sure to add name:) and let the others use the external Docker network.
You should not assign a non-existing entrypoint web-secure to a router, that will probably break the dynamic config.
Mostly you can not place a web app with GUI on an arbitrary PathPrefix(). They usually have fixed paths they work on (like /) and will mostly respond with absolute paths for links, redirects, scripts and images. This usually only works when you can set some kind of "base path". Use a sub-domain instead.
Finally, itβs not best practice to have the target services expose ports via ports. As that enables access to the target services potentially circumventing any Traefik security middlewares. Within Docker networks the ports are all enabled.
So, I've created the network externally (with portainer web-ui) and make it attachable, then modify my docker compose like this (both containers are now on the same "audiobook" network)
I will probably not being able to setup Letsencrypt since I'm on a local network ? Using a self-signed certificat for testing would be enough ?
From a security standpoint, since traefik need access to each separate docker networking, is it still a good pratice to separate each one of them on its own network ?
If you think there is a risk from a service/container, then I would create a separate Docker network.
We only have 10+ services of our own application, they all run over the same proxy network.
You can not create valid LetsEncrypt TLS certs for localhost. If you just enbale .tls=true, then Traefik will generate a custom cert, you can just select trust/continue in your browser.
Indeed, I've just enabled TLS without issue. I can access the debug interface successfully but I'm still unable to reach the container behind traefik with my local subdomain, despite being on the same network
Yes indeed, I've registered nas.local pointing to the traefik server IP on my computer DNS file and defined this label to create the subdomain on my container