I have a project with Spring Boot as a microservice. In Docker Compose, when the config service is executed, the other services must be executed. I have done this with depend on. But sometimes other services come up without the config service coming up. Is there a standard solution to have the second service come up after the config and not before it? this is my sample docker-compose.yml:
`version: "3.9"
services:
config-service:
image: 'config-service:v1-BETA'
build: '/opt/core/config-service/.'
container_name: 'config-service'
restart: always
volumes:
- db-data:/opt/core/data
networks:
- core-network
ports:
- "8088:8088"
discovery-service:
image: 'discovery-service:v1-BETA'
build: '/opt/core/discovery-service/.'
container_name: 'discovery-service'
depends_on:
- config-service
ports:
- "8061:8061"
restart: always
volumes:
- db-data:/opt/core/data
networks:
- core-network
environment:
- "SPRING_PROFILES_ACTIVE=prod"
I also added server resources and tried to find a way like sleep function but failed