From 159d9927834a6d4b80e15b5adedf3f84a921b8be Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Thu, 2 Oct 2025 18:16:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(config)=20add=20healthcheck=20to?= =?UTF-8?q?=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes docker-compose up --wait work. --- Dockerfile | 3 +++ docker-compose.yml | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index 987b3d7..3e7e1d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,9 @@ CMD ["gunicorn", "-c", "/usr/local/etc/gunicorn/satosa.py"] # ---- Development image ---- FROM common AS development +# Install curl (for healthchecks) +RUN apt-get update && apt-get install -qy curl + # Playwright browsers ENV PLAYWRIGHT_BROWSERS_PATH=/pw-browsers RUN pip install playwright diff --git a/docker-compose.yml b/docker-compose.yml index a4c9c97..46075ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,6 +40,13 @@ services: - ./docker/files/usr/local/etc/gunicorn/satosa.py:/usr/local/etc/gunicorn/satosa.py depends_on: - redis + healthcheck: + test: ["CMD", "curl", "--fail", "http://localhost:8000/ping"] + interval: 60s + timeout: 5s + retries: 3 + start_period: 30s + start_interval: 1s oidc-test-client: build: docker/oidc-test-client