Commands placement

I deployed my traefik with a file called dynamic.yml which contains the commands from the docker-compose file. How would I do the same with this node--exporter example?

node-exporter:
    image: prom/node-exporter
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command: 
      - '--path.procfs=/host/proc' 
      - '--path.sysfs=/host/sys'
      - --collector.filesystem.ignored-mount-points
      - "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
    ports:
      - 9100:9100
    networks:
      - monitor-net
    deploy:
      mode: global
      restart_policy:
        condition: on-failure

Traefik docker-compose.yml command is the static configuration, which can also be placed in traefik.yml. That’s a Traefik feature, so you can’t just place commands in another file.

Traefik dynamic config is either placed in a file and read via provider.file or you can use labels with provider.docker.