I've got a simple webapp that has a web-server and a restful api-service. I cannot get the web-server app to connect to the restful api-service using the service name. I can reach the api service if I use the IP address.
Here's my compose file
version: '3'
services:
my-app:
image: my-app:1.0.0
ports:
- "5000:5000"
networks:
- my-network
my-api:
image: my-api:1.0.0
ports:
- "3000:3000"
networks:
- my-network
networks:
my-network:
I'm running a swarm on a single machine with 1 replica. If I connect with the local IP address in the web-app it connects but fails when I try http://my-api:3000
Any ideas?