feat(docker compose): healthcheck for speckle-server (#1651)

* feat(docker compose): healthcheck for speckle-server
- if speckle server pod becomes unresponsive (but has not yet exited with a non-zero exit code), it will be automatically restarted after 30s.

* feat(1click): add healthcheck to speckle-server container running in DigitalOcean 1click

* fix(1click): remove command statements
- the docker image is responsible for providing these
This commit is contained in:
Iain Sproat
2023-06-29 14:55:40 +01:00
committed by GitHub
parent 40fec1efde
commit fa36e9e40c
2 changed files with 20 additions and 4 deletions
+10
View File
@@ -17,6 +17,16 @@ services:
dockerfile: packages/server/Dockerfile
image: speckle/speckle-server:local
restart: always
healthcheck:
test:
- CMD
- node
- -e
- "require('node:http').request({headers: {'Content-Type': 'application/json'}, port:3000, hostname:'127.0.0.1', path:'/graphql?query={serverInfo{version}}', method: 'GET' }, (res) => { body = ''; res.on('data', (chunk) => {body += chunk;}); res.on('end', () => {process.exit(res.statusCode != 200 || body.toLowerCase().includes('error'));}); }).end();"
interval: 10s
timeout: 10s
retries: 3
start_period: 5s
environment:
# TODO: Change this to the URL of the speckle server, as accessed from the network
CANONICAL_URL: 'http://localhost'