Docker service stuck in New state (Swarm)
It seems the resource limitation of overlay IP address amount these swarm tasks. You could create a Docker network with larger range of subnet, like 10.10.0.0/16. Then, use it in your compose file to create a service. I think this could resolve this problem.
Each service and task gets IP address so the overlay network that the services get connected should have subnet that can support enough ip addresses.
Use following command to create docker network with larger range of supported IPs:
docker network create --driver=overlay --subnet=10.10.0.0/16 <network_name>
Reference: https://github.com/docker/for-aws/issues/104#issuecomment-331563445 https://docs.docker.com/engine/reference/commandline/network_create/
The option --endpoint-mode=dnsrr
on every services seems to solve this issue.