From efbd08cd9e80ab0a4fcf0405ba97082c2ce674cc Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 6 May 2026 11:27:51 +0200 Subject: [PATCH] Ref #1267: Add healthcheck for web in docker compose --- RemoteSettings.Dockerfile | 5 +++++ docker-compose.yml | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/RemoteSettings.Dockerfile b/RemoteSettings.Dockerfile index 892941a4..6649f4b2 100644 --- a/RemoteSettings.Dockerfile +++ b/RemoteSettings.Dockerfile @@ -98,5 +98,10 @@ FROM production AS local ENV GRANIAN_STATIC_PATH_ROUTE=/attachments ENV GRANIAN_STATIC_PATH_MOUNT=/tmp/attachments +# Install curl for readiness test in docker compose +USER root +RUN /opt/update_and_install_system_packages.sh curl +USER app + # create directories for volume mounts used in browser tests / local development RUN mkdir -p -m 777 /app/mail && mkdir -p -m 777 /app/slack && mkdir -p -m 777 /tmp/attachments diff --git a/docker-compose.yml b/docker-compose.yml index 1900f034..0613e993 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,6 +62,12 @@ services: - debug-mail:/app/mail - debug-slack:/app/slack - attachments:/tmp/attachments + healthcheck: + test: ["CMD", "curl", "-fsS", "http://localhost:8888/v1/__lbheartbeat__"] + interval: 2s + timeout: 5s + retries: 30 + start_period: 5s git-reader: build: @@ -81,7 +87,8 @@ services: image: remotesettings/browser-tests profiles: [browser-tests] depends_on: - - web + web: + condition: service_healthy environment: - SERVER=http://web:8888/v1 - MAIL_DIR=/var/debug-mail/ @@ -103,5 +110,7 @@ services: volumes: - ./config/nginx.conf:/etc/nginx/conf.d/default.conf depends_on: - - web - - git-reader + web: + condition: service_healthy + git-reader: + condition: service_started