I had similar issue. Try to set action in Docker Compose Launch Settings to Start debugging for every project.
VisualStudio debug services on Docker-Compose not starting
BenT
20
Reputation points
Hi,
I try to debug 3 services using Docker-Compose in VS 2022.
ServiceC depends on ServiceB which depends on ServiceA.
All of these "depends*on" use condition: service_*healthy and every service has a healtcheck.
VS will only start container A and when it is healthy it starts B which never gets healthy bc only the container is run but the service inside will not be executed and never gets healthy.
Everything works fine without VS when using docker-compose.
I can provide an example project if somebody wants to test.
Any idea what's wrong here?
version: '3.4'
services:
dependsontest:
image: ${DOCKER_REGISTRY-}dependsontest
build:
context: .
dockerfile: DependsOnTest/Dockerfile
healthcheck:
test: curl --silent --fail http://localhost:1224/WeatherForecast || exit 1
interval: 5s
timeout: 5s
retries: 5
dependsontest_b:
image: ${DOCKER_REGISTRY-}dependsontestb
build:
context: .
dockerfile: DependsOnTest_B/Dockerfile
healthcheck:
test: curl --silent --fail http://localhost:1224/WeatherForecast || exit 1
interval: 5s
timeout: 5s
retries: 5
depends_on:
dependsontest:
condition: service_healthy
dependsontest_c:
image: ${DOCKER_REGISTRY-}dependsontestc
build:
context: .
dockerfile: DependsOnTest_C/Dockerfile
healthcheck:
test: curl --silent --fail http://localhost:1224/WeatherForecast || exit 1
interval: 5s
timeout: 5s
retries: 5
depends_on:
dependsontest_b:
condition: service_healthy