I am trying to setup traefik as a container and I'm running into two problems. One I have had from the start, the other from the moment I wanted to drop traefik_dynamic.toml for label entries in the docker compose file.
[UPDATE: Solved, see below]
I can't get any logging to work. I can see very basic logging when I start the container with docker compose up without -d:
root@snape:/srv/docker/traefik# docker compose up --force-recreate
[+] Running 1/0
⠿ Container traefik Recreated 0.1s
Attaching to traefik
traefik | time="2022-10-16T21:10:26Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.toml"
but with -d no logging is written in the log files, whatever I try. It seems that without -d the logging is also not DEBUG, so I wonder if my traefik.toml is correct
I can't get my existing certificates to work. This worked when I had this defined traefik_dynamic.toml but I can't get it working via the labels entry in the docker compose file.
I'd like to know how to get traefik to use the default certificate for any service (either in traefik.toml or in the labels: section of docker-compose.yml). And note: I don't want to use traefik's own letsencrypt integration, it needs to use a cert that is in files somewhere on the system (regardless if it is currently letsencrypt that is providing the cert)
There are three different, mutually exclusive (i.e. you can use only one at the same time), ways to define static configuration options in Traefik:
In a configuration file
In the command-line arguments
As environment variables
The problem with using commands is it is mutually exclusive with a configuration file.
tls.stores (that defines the default cert) must be defined in the dynamic config, but defining it with labels doesn't work. Hence, I need to use a static config file to load the shared dynamic config file which excludes the use of commands in the compose file.
This is of course based on limited understanding and experience (beginner) so I'd be happy to try a compose label solution that enables me to drop the dynamic config file.
Yes I know, that is what I wrote in my own solution above. But it was unexpected (and weird) that the rule that static entries can be given by command and dynamic by label is not always true. Maybe this should be considered a bug? Should I file one?