I have a service which is being accessed from other container, and also from the host itself. definition in docker-compose.yaml
version: "3.8"
services:
ads:
image: cloud.dev/ads:test1
container_name: ads
hostname: ads
ports:
- "9001:9000"
Other containers access this service with ads:9000
while I access from the Host with ads:9001
to that application and it works!
Then I tested docker swarm
.
I created a stack ams_stack
And I defined my ads
service for ams_stack
version: "3.8"
services:
ads:
image: cloud.dev/ads:test1
deploy:
replicas: 1
placement:
constraints:
- "node.role==worker"
hostname: ams_stack_ads
ports:
- "9001:9000"
I see that service is being run!
6b0f8d514f02 cloud.dev/ads:test1 "dssrv_mssql.exe -ad…" 3 hours ago Up 3 hours ams_stack_ads.1.owmej7byvzhnwud98dwmo4joe
So I tried to access with:
ams_stack_ads:9001
ams_stack_ads:9000
ads:9001
ads:9000
nothing works... please help...Thanks