Issue with traefik /etc/traefik/traefik.yaml is a directory

I am trying to setup traefik with docker compose but getting error /etc/traefik/traefik.yaml is a directory , I didn't understand how its reading it as a directory as its a yaml file .

I have tried almost everything that i can find on internet please help me fix this issue

I am using a static config file , where i have a traefik.yaml file is stored in /config/traefik.yaml

Docker file :

Error :

Please use formatted text for code/config, not screenshots.

You have not proven that traefik.yml is not a directory on host.

I have tried using this but still same issue

traefik.yaml is a file on host

permission of file :

image

directory location

I think you have a typo in you compose file - you are mounting /config (root -> config) while your ls -l screenshot refers to /home/senpai/SkyScrape/config

If this is not the reason try following: I remember similar issue when I tried to mount individual config files and the file didn't exist - Docker by default mounts a directory. If you had this before this might be a reason. Please do a fresh compose init (docker compose down, remove dangling images and fresh start with docker compose up) maybe this resolves the problem already.