From 088eee39e1505bd939a1fbf5406f36fe685cda4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxi=20Quo=C3=9F?= Date: Fri, 15 Oct 2021 02:25:33 +0200 Subject: [PATCH] set healthcheck in dockerfile --- Dockerfile | 3 +++ docker-compose.yml | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02094289..47f74044 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,7 @@ RUN apt-get update && \ apt-get -y install iputils-ping nmap curl && \ rm -rf /var/lib/apt/lists/* +HEALTHCHECK --interval=10s \ + CMD curl -fs "http://localhost:$DJANGO_PORT/health/" || exit 1 + CMD ["./run.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index f82fdd63..4256e7be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,9 +18,6 @@ services: - POSTGRES_PASSWORD=upsnap - PING_INTERVAL=5 - ENABLE_NOTIFICATIONS=True - healthcheck: - test: curl --fail -s http://localhost:$DJANGO_PORT/health/ || exit 1 - interval: 10s depends_on: - upsnap_redis - upsnap_postgres