Gateway Timeout when running CMK in Docker container

I have now found the issue, it was indeed with Traefik and not CheckMK.

The CMK container is on more than one docker network, the one that everything traefik uses and a separate one allowing it to talk to my postfix container. Traefik seeminly randomly chooses which of the two virtual addresses to contact the CMK container on and sometimes chose the one that CMK had in the postfix network, meaning it ultimately was denied access and therefore gave a timeout.

The fix was to specify the traefik.docker.network label so that traefik always sends data on the address in the network traefik and the CMK container shares.