From bd06aae5c1fc176df27526bb34e8d8952ddc485e Mon Sep 17 00:00:00 2001 From: Dmytro Pashynskyi Date: Fri, 6 Sep 2024 12:08:02 +0300 Subject: [PATCH] feat: add Docker healthcheck --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 15905b0..1e0b4b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,9 +46,11 @@ COPY --chown=appuser ./aidial_analytics_realtime /aidial_analytics_realtime ENV PATH="/opt/venv/bin:$PATH" - USER appuser +HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=6 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1 + # During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug EXPOSE 5000 CMD ["uvicorn", "aidial_analytics_realtime.app:app", "--host", "0.0.0.0", "--port", "5000"]