Below is the working docker-compose file in v2 spec:
version: \'2\' volumes: webroot: driver: local services: app: # Launch uwsgi application server
that is how Docker works because the hostname is not unique and that will lead to a problem if you give two containers the same hostname therefore compose will always use the service name for DNS resolution
hostname