I was not able to find the specification, but here is the example from the official repository docker/awesome-compose#angular
The compose is the following
services:
web:
build:
context: angular
target: builder
ports:
- 4200:4200
volumes:
- ./angular:/project
- /project/node_modules # <-- problematic line
I was looking at the containers/podman-compose project, and this case is commented as followed
Anonymous: Just specify a path and let the engine creates the volume1
It seems that they consider the following, if the short mount is only a path, it must be volume that is anonymous (not explicitly defined)