Nope.
You’ve been giving your Docker container your Cloudflare credentials, but doing nothing with them. To enable the DNS challenge, you need to use the tls
directive / dns
subdirective:
- dns enables the DNS challenge using the specified provider plugin, which must be plugged in from one of the caddy-dns repositories. Each provider plugin may have their own syntax following their name; refer to their docs for details. Maintaining support for each DNS provider is a community effort. Learn how to enable the DNS challenge for your provider at our wiki.
That means the Docker container has been maintaining certs using HTTP or TLS-ALPN challenges.
Which, in turn, means that you’ve got some other issue going on when you run it manually. Lets walk back to here:
What, specifically, is telling you that Caddy failed to get certs because of a lack of Cloudflare credentials? Was it some output from the Caddy command that indicated this?
I suspect a closer look at the output might give a better idea of what actually failed.