Skip to content

Implementar health checks en docker-compose - #4

Merged
cabrasky merged 1 commit into
mainfrom
issue-1-health-checks
Jul 1, 2026
Merged

cabrasky merged 1 commit into
mainfrom
issue-1-health-checks

Conversation

@cabrasky

@cabrasky cabrasky commented Jul 1, 2026

Copy link
Copy Markdown
Owner

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)

  • Health check con pg_isready -U ${POSTGRES_USER}
  • Intervalo: 10s, Timeout: 5s, Retries: 5, Start period: 30s

backend (Spring Boot)

  • Health check con curl -f http://localhost:8080/actuator/health
  • Intervalo: 15s, Timeout: 5s, Retries: 3, Start period: 60s

frontend (Nginx)

  • Health check con curl -f http://localhost:80/
  • Intervalo: 15s, Timeout: 5s, Retries: 3, Start period: 30s

Dependencias

  • Backend depende de db con condition: service_healthy
  • Frontend depende de backend con condition: service_healthy

Closes #1

- 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
Copilot AI review requested due to automatic review settings July 1, 2026 08:13
@cabrasky
cabrasky merged commit d320eef into main Jul 1, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 healthcheck al servicio db usando pg_isready.
  • Se añade healthcheck al servicio backend usando /actuator/health y se actualiza depends_on a condition: service_healthy.
  • Se añade healthcheck al servicio frontend (HTTP) y se actualiza depends_on a condition: service_healthy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: health checks en docker-compose para arranque fiable

2 participants