I using docker-compose in version 3.3 and I want to wait for a container with spring app is up and after that other containers with spring boot app should be started. I tried with health check but it's doesn't work. This is my docker-compose looks like:
version: '3.3'
services:
eureka:
build: ./eureka
ports:
- 8761:8761
networks:
- spring-cloud-network
environment:
- SPRING_ZIPKIN_BASEURL=http://zipkin:9411
depends_on:
- zipkin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8761"]
interval: 10s
timeout: 10s
retries: 5
zipkin:
build: ./zipkin
ports:
- 9411:9411
networks:
- spring-cloud-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9411"]
interval: 10s
timeout: 10s
retries: 5
Is it possible to achieve what I want?