gpt4 book ai didi

docker - Traefik Docker 热重载配置

转载 作者:行者123 更新时间:2023-12-02 01:03:47 27 4
gpt4 key购买 nike

我正在尝试从外部更新我的 traefik.yml,并希望通过 docker-compose.yml 设置的 Traefik 容器实例。但事实证明它没有用。
我已将 traefik.yml 映射到实例中:

volumes:
- ./traefik/traefik.toml:/traefik.toml
但它似乎不会在文件更新时自动重新加载。
我试图进入容器并检查文件是否更新,它似乎更新得很好。
如何使自动重新加载在 Docker 中工作?

最佳答案

看起来 traefik 只能通过更改配置来观察前端、后端规则和 https 证书。

从文档:

To enable the file backend, you must either pass the --file option to the Træfik binary or put the [file] section (with or without inner settings) in the configuration file. The configuration file allows managing both backends/frontends and HTTPS certificates (which are not Let's Encrypt certificates generated through Træfik).



您需要添加一个额外的
[file]
watch = true

启用文件监视和动态配置

关于docker - Traefik Docker 热重载配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48877567/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com