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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user