Skip to content

Commit

Permalink
ci(test): Add health check for WebDAV docker compose config (#3448)
Browse files Browse the repository at this point in the history
Signed-off-by: Manjusaka <[email protected]>
  • Loading branch information
Zheaoli authored Nov 1, 2023
1 parent 34f9fa0 commit 0282e75
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions fixtures/webdav/config/nginx/http.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"}';
}
}
7 changes: 6 additions & 1 deletion fixtures/webdav/docker-compose-webdav-with-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
7 changes: 6 additions & 1 deletion fixtures/webdav/docker-compose-webdav-with-empty-passwd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
6 changes: 5 additions & 1 deletion fixtures/webdav/docker-compose-webdav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

0 comments on commit 0282e75

Please sign in to comment.