Repository navigation
Implementar health checks en docker-compose - #4
Merged
Merged
Conversation
- Add health check for db using pg_isready (interval: 10s, timeout: 5s, retries: 5, start_period: 30s) - Add health check for backend using actuator/health endpoint (interval: 15s, timeout: 5s, retries: 3, start_period: 60s) - Add health check for frontend using curl on port 80 (interval: 15s, timeout: 5s, retries: 3, start_period: 30s) - Update depends_on to use condition: service_healthy for ordered startup Closes #1
There was a problem hiding this comment.
Pull request overview
Este PR incorpora health checks en docker-compose.yml para que depends_on pueda esperar a que los servicios estén realmente “healthy” antes de arrancar los dependientes, mejorando el orden de inicio y la detección temprana de fallos, tal como pide el Issue #1.
Changes:
- Se añade
healthcheckal serviciodbusandopg_isready. - Se añade
healthcheckal serviciobackendusando/actuator/healthy se actualizadepends_onacondition: service_healthy. - Se añade
healthcheckal serviciofrontend(HTTP) y se actualizadepends_onacondition: service_healthy.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descripción
Se agregan health checks a todos los servicios del docker-compose para asegurar un orden de inicio correcto y detectar fallos de manera temprana.
Cambios realizados
db (PostgreSQL)
pg_isready -U ${POSTGRES_USER}backend (Spring Boot)
curl -f http://localhost:8080/actuator/healthfrontend (Nginx)
curl -f http://localhost:80/Dependencias
condition: service_healthycondition: service_healthyCloses #1