Giter Club home page Giter Club logo

Comments (4)

lbenguigui avatar lbenguigui commented on May 23, 2024

Hello @WPF0414 ,

Thanks for your interest in Traefik.

The error you've encountered is due to the file provider interpreting {{.ContainerName}} as a Go template and attempting to populate it.
I recommend splitting your static and dynamic configurations into dedicated files, this should resolve the issue you're facing.

Feel free to leave a new comment if you continue to experience any issues.

from traefik.

WPF0414 avatar WPF0414 commented on May 23, 2024

@lbenguigui thanks!How do I deal with it? I'm currently using lable:traefik. http. routers. xxx. Rule is processed in the form of providers. Docker. defaultrule deleted, but I could have used it in the command in docker-compose before.

from traefik.

lbenguigui avatar lbenguigui commented on May 23, 2024

Hello @WPF0414 ,

If you want to split static & dynamic configuration that coming from your file provider, I suggest you to replace :

...
providers:
  providersThrottleDuration: 2s
  docker:
    watch: true
    network: traefik
    defaultrule: Host(`{{ .ContainerName }}.xxxx.com`)
    endpoint: unix:///var/run/docker.sock
  file:
    watch: true
    directory: /etc/traefik
...

by :

...
providers:
  providersThrottleDuration: 2s
  docker:
    watch: true
    network: traefik
    defaultrule: Host(`{{ .ContainerName }}.xxxx.com`)
    endpoint: unix:///var/run/docker.sock
  file:
    watch: true
    filename: /etc/traefik/my_dedicated_file.yaml #or directory: /etc/traefik/my_dedicated_directory
...

And set all the dynamic configuration related to the file provider in the dedicated file (or directory).

from traefik.

WPF0414 avatar WPF0414 commented on May 23, 2024

I have used the docker label to solve this problem, thank you very much!

from traefik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.