diff --git a/Dockerfile b/Dockerfile index 9477d4e..3ad4b19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,4 +20,5 @@ RUN npm run build # entry WORKDIR /usr/src/guppe EXPOSE 443 80 +HEALTHCHECK CMD /usr/bin/curl --fail http://localhost/ || exit 1 CMD [ "node", "index.js" ] diff --git a/index.js b/index.js index 5eb404a..98b1360 100644 --- a/index.js +++ b/index.js @@ -225,10 +225,10 @@ client.connect() console.log('Guppe server listening on port ' + PORT_HTTPS) }) onShutdown(async () => { - await client.close() await new Promise((resolve, reject) => { server.close(err => (err ? reject(err) : resolve())) }) + await client.close() console.log('Guppe server closed') }) })