Docker compose issue with swagger-server
Hi all, I am facing an issue with an issue with swagger boot when you running $ docker-compose up.
I am using a centralized swagger for microservices it is working fine when running locally but when I am running the same application with docker-compose I need to re run my swagger-server service container manually after docker compose up.
the issue is that when I am running all my microservice with docker-compose I am unable hit any end point on port which is running swagger-server. When I am hitting any port I am getting
this page isn’t working right now
local host didn’t send any data
swagger-server:
image: tejajagadeep/movie-app-swagger-server:latest
container_name: swagger-server
environment:
- eureka.client.service-url.defaultZone=http://eureka-server:8761/eureka
- spring.config.import=optional:configserver:http://config-server:8888/
ports:
- "8769:8769"
networks:
- my-movie-network
depends_on:
- eureka-server
- config-server
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8769/actuator/health"]
interval: 20s
timeout: 10s
retries: 10
but if re run my swagger-server image it is working fine. ( I am using open docs web mvc dependency in my spring boot swagger server]
How can I resolve this issue I don’t think there is any issue with the code cause I have everything in the application property itself.
2
Answers
Solution:
I added this which solved the issue
Can you add docker compose logs, when you run docker compose up for the first time? It will be easier to detect the problem.
Or check that helthcheck woks correctly.