diff --git a/backend/Dockerfile b/backend/Dockerfile index 07611c6..68083c4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -26,4 +26,8 @@ USER app EXPOSE 8000 +# Mark the container unhealthy if the API stops answering /health (no curl in slim image). +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=4)"] + CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]