From 0282e7562ee944d14b9f7a3c9760fa2296f07546 Mon Sep 17 00:00:00 2001 From: Nadeshiko Manju Date: Wed, 1 Nov 2023 15:26:14 +0800 Subject: [PATCH] ci(test): Add health check for WebDAV docker compose config (#3448) Signed-off-by: Manjusaka --- fixtures/webdav/config/nginx/http.conf | 5 +++++ fixtures/webdav/docker-compose-webdav-with-auth.yml | 7 ++++++- .../webdav/docker-compose-webdav-with-empty-passwd.yml | 7 ++++++- fixtures/webdav/docker-compose-webdav.yml | 6 +++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/fixtures/webdav/config/nginx/http.conf b/fixtures/webdav/config/nginx/http.conf index 4bacedfad25a..b413cb4cf8fd 100644 --- a/fixtures/webdav/config/nginx/http.conf +++ b/fixtures/webdav/config/nginx/http.conf @@ -10,4 +10,9 @@ server { # forward all other requests to port 80 proxy_pass http://127.0.0.1:80; } + location /health { + access_log off; + add_header 'Content-Type' 'application/json'; + return 200 '{"status":"UP"}'; + } } diff --git a/fixtures/webdav/docker-compose-webdav-with-auth.yml b/fixtures/webdav/docker-compose-webdav-with-auth.yml index 6bb1b419e43a..b138ab167267 100644 --- a/fixtures/webdav/docker-compose-webdav-with-auth.yml +++ b/fixtures/webdav/docker-compose-webdav-with-auth.yml @@ -24,9 +24,14 @@ services: - "8080:80" volumes: - webdav-data:/data + - ./config:/config environment: - WEBDAV_USERNAME=bar - WEBDAV_PASSWORD=bar - + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:81/health"] + interval: 3s + timeout: 5s + retries: 5 volumes: webdav-data: diff --git a/fixtures/webdav/docker-compose-webdav-with-empty-passwd.yml b/fixtures/webdav/docker-compose-webdav-with-empty-passwd.yml index c7046213b1c7..39a1db575758 100644 --- a/fixtures/webdav/docker-compose-webdav-with-empty-passwd.yml +++ b/fixtures/webdav/docker-compose-webdav-with-empty-passwd.yml @@ -24,8 +24,13 @@ services: - "8080:80" volumes: - webdav-data:/data + - ./config:/config environment: - WEBDAV_USERNAME=foo - + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:81/health"] + interval: 3s + timeout: 5s + retries: 5 volumes: webdav-data: diff --git a/fixtures/webdav/docker-compose-webdav.yml b/fixtures/webdav/docker-compose-webdav.yml index 27edb45e6486..bbab986202da 100644 --- a/fixtures/webdav/docker-compose-webdav.yml +++ b/fixtures/webdav/docker-compose-webdav.yml @@ -29,6 +29,10 @@ services: # the following volume is used to redirect 81 port to 80 port # ./config/nginx/http.conf will be appended to the default nginx.conf - ./config:/config - + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:81/health"] + interval: 3s + timeout: 5s + retries: 5 volumes: webdav-data: