While deploying stacks (`docker-compose`) using Portainer, the web interface does not allow the `.yml` file to have two `<<` tags in the same level. Therefore replacing two of them as one in brackets solves the issue.
This configuration works both with the Portainer web interface and the docker-compose cli without any problems.
Know more about Portainer at https://www.portainer.io/