Can't mount directory/file

You changed the filename in the container, not on the host. That’s why it worked. The left side is the path on the host and the right side is the path in the container.

The error message mentiones:

error mounting "/dashy/my-conf.yml"

without the tilde character at the beginning which indicates that user’s home is the system root. Unless you removed the original home from the error message. Maybe you are trying to run Docker with a different user so the file does exist ibut not where Docker is looking for it. When compose try to mount a nonexistent file it will create it as a folder and mounts that. At least when you use the short syntax not the long syntax. So you tried to mount a folder onto a file exactly as the error message says. Then you changed the path in the container so you mounted a folder in the container at a location where no file or folder existed so it worked.

PS: I formatted your post, but please, follow @bluepuma77’s instructions next time and format your post properly. More help: How to format your forum posts