summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristopher May-Townsend <chris@maytownsend.co.uk>2021-05-05 16:33:04 +0100
committerGitHub <noreply@github.com>2021-05-05 17:33:04 +0200
commitd5305000f1c5799ffb6fcd64ad27e7bfd8ba2113 (patch)
tree98edbe304353f24ccd61303d3e4ec443eebe134d
parentLeave out optional keys from /sync (#9919) (diff)
downloadsynapse-d5305000f1c5799ffb6fcd64ad27e7bfd8ba2113.tar.xz
Docker healthcheck timings - add startup delay and changed interval (#9913)
* Add healthcheck startup delay by 5secs and reduced interval check to 15s
to reduce waiting time for docker aware edge routers bringing an
instance online
Diffstat (limited to '')
-rw-r--r--changelog.d/9913.docker1
-rw-r--r--docker/Dockerfile2
-rw-r--r--docker/README.md17
3 files changed, 16 insertions, 4 deletions
diff --git a/changelog.d/9913.docker b/changelog.d/9913.docker
new file mode 100644
index 0000000000..93835e14cb
--- /dev/null
+++ b/changelog.d/9913.docker
@@ -0,0 +1 @@
+Added startup_delay to docker healthcheck to reduce waiting time for coming online, updated readme for extra options, contributed by @Maquis196.
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 4f5cd06d72..2bdc607e66 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -88,5 +88,5 @@ EXPOSE 8008/tcp 8009/tcp 8448/tcp
 
 ENTRYPOINT ["/start.py"]
 
-HEALTHCHECK --interval=1m --timeout=5s \
+HEALTHCHECK --start-period=5s --interval=15s --timeout=5s \
     CMD curl -fSs http://localhost:8008/health || exit 1
diff --git a/docker/README.md b/docker/README.md
index a7d1e670fe..c8d3c4b3da 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -191,6 +191,16 @@ whilst running the above `docker run` commands.
 ```
    --no-healthcheck
 ```
+
+## Disabling the healthcheck in docker-compose file
+
+If you wish to disable the healthcheck via docker-compose, append the following to your service configuration.
+
+```
+  healthcheck:
+    disable: true
+```
+
 ## Setting custom healthcheck on docker run
 
 If you wish to point the healthcheck at a different port with docker command, add the following
@@ -202,14 +212,15 @@ If you wish to point the healthcheck at a different port with docker command, ad
 ## Setting the healthcheck in docker-compose file
 
 You can add the following to set a custom healthcheck in a docker compose file.
-You will need version >2.1 for this to work. 
+You will need docker-compose version >2.1 for this to work. 
 
 ```
 healthcheck:
   test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
-  interval: 1m
-  timeout: 10s
+  interval: 15s
+  timeout: 5s
   retries: 3
+  start_period: 5s
 ```
 
 ## Using jemalloc