Fix API deploy healthcheck by starting Kestrel before migrate/seed.
CI / backend (push) Canceled after 0s
CI / frontend (push) Canceled after 0s

Compose was marking the API unhealthy because bootstrap blocked app.Run(), so /health/live never answered within the HEALTHCHECK window.
This commit is contained in:
2026-10-04 19:27:21 +08:00
parent d013dd4bb5
commit 7d7332641f
9 changed files with 915 additions and 22 deletions
+3 -1
View File
@@ -52,7 +52,9 @@ USER app
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
# Liveness only (/health/live). Readiness is asserted by CD smoke (/health/ready).
# start-period covers process + Kestrel bind; migrate/seed no longer block listen.
HEALTHCHECK --interval=10s --timeout=5s --start-period=40s --retries=6 \
CMD curl -fsS http://localhost:8080/health/live || exit 1
ENTRYPOINT ["dotnet", "VigilCareRecordsAPI.dll"]