From d9bc304217573f75c3d0e6ca0703ae792d05d13d Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Wed, 9 Jun 2021 16:34:57 +0200 Subject: [PATCH] Added healthcheck in Dockerfile Signed-off-by: Louis Vallat --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 861a09f..2a7658d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ COPY . . RUN cargo install --path . FROM debian:buster-slim -RUN apt-get update && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y libpq-dev curl && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local/cargo/bin/moviequotebot_api /usr/local/bin/moviequotebot_api EXPOSE 8080 +HEALTHCHECK CMD curl --fail http://localhost:8080 || exit 1 CMD ["moviequotebot_api"] \ No newline at end of file