0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 02:31:08 +00:00

Add health checks

This commit is contained in:
Alexander Konietzko 2023-07-15 13:33:11 +02:00
parent 89c326a8b7
commit 17fdab8e06
No known key found for this signature in database
GPG Key ID: BA6905F37AEC2B5B
2 changed files with 9 additions and 1 deletions

View File

@ -14,5 +14,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
WORKDIR /app
COPY --from=build /app/CleanArchitecture.Api/out ./
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl --fail http://localhost/healthz || exit 1
EXPOSE 80
ENTRYPOINT ["dotnet", "CleanArchitecture.Api.dll"]

View File

@ -10,10 +10,15 @@ services:
- db
links:
- db
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
interval: 30s
timeout: 5s
retries: 3
db:
image: mcr.microsoft.com/mssql/server
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=YourStrongPassword
- SA_PASSWORD=Password123!#
ports:
- 1433:1433