Help me understand why healthcheck does not work by service name when I use multiymls configuration.
I have main.yml and prod.yml
I have commonmainprod.yml which simply contains all in one.
Service name webui:
<code>services:
webui:
container_name: webuiprice${APP_ENV_PROD:-prod}
image: ${REGISTRY_ADDR}/price/webui:${APP_ENV_PROD:-prod}_sw_${VERSION:-0.1.0}
....
</code>
<code>services:
webui:
container_name: webuiprice${APP_ENV_PROD:-prod}
image: ${REGISTRY_ADDR}/price/webui:${APP_ENV_PROD:-prod}_sw_${VERSION:-0.1.0}
....
</code>
services:
webui:
container_name: webuiprice${APP_ENV_PROD:-prod}
image: ${REGISTRY_ADDR}/price/webui:${APP_ENV_PROD:-prod}_sw_${VERSION:-0.1.0}
....
Healthcheck:
<code> test: curl --fail http://webui:8090 || exit 1
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
</code>
<code> test: curl --fail http://webui:8090 || exit 1
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
</code>
test: curl --fail http://webui:8090 || exit 1
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
no_proxy:
<code>no_proxy == 'localhost,webui,price-prod_webui
</code>
<code>no_proxy == 'localhost,webui,price-prod_webui
</code>
no_proxy == 'localhost,webui,price-prod_webui
When i deploy stack from :
<code>docker stack deploy -c main.yml -c prod.yml stack-prod
</code>
<code>docker stack deploy -c main.yml -c prod.yml stack-prod
</code>
docker stack deploy -c main.yml -c prod.yml stack-prod
healthcheck get error:
<code>curl --fail http://webui:8090 -v
* Uses proxy env variable no_proxy == 'localhost,webui,price-prod_webui'
* Could not resolve host: webui
* Closing connection 0
curl: (6) Could not resolve host: webui
</code>
<code>curl --fail http://webui:8090 -v
* Uses proxy env variable no_proxy == 'localhost,webui,price-prod_webui'
* Could not resolve host: webui
* Closing connection 0
curl: (6) Could not resolve host: webui
</code>
curl --fail http://webui:8090 -v
* Uses proxy env variable no_proxy == 'localhost,webui,price-prod_webui'
* Could not resolve host: webui
* Closing connection 0
curl: (6) Could not resolve host: webui
When i deploy stack from :
<code>docker stack deploy -c commonmainprod.yml stack-prod
</code>
<code>docker stack deploy -c commonmainprod.yml stack-prod
</code>
docker stack deploy -c commonmainprod.yml stack-prod
Healthcheck get OK:
<code>curl --fail http://webui:8090 -v
* Trying webui:8090...
* Connected to webui (127.0.0.1) port 8090 (#0)
> GET / HTTP/1.1
> Host: webui:8090
> User-Agent: curl/7.88.1
> Accept: */*
</code>
<code>curl --fail http://webui:8090 -v
* Trying webui:8090...
* Connected to webui (127.0.0.1) port 8090 (#0)
> GET / HTTP/1.1
> Host: webui:8090
> User-Agent: curl/7.88.1
> Accept: */*
</code>
curl --fail http://webui:8090 -v
* Trying webui:8090...
* Connected to webui (127.0.0.1) port 8090 (#0)
> GET / HTTP/1.1
> Host: webui:8090
> User-Agent: curl/7.88.1
> Accept: */*
Why error?