compose: Add healthchecks to the peertube app service definition
This commit adds a native healthcheck to the peertube app service using the nodejs command line interface. kudos to @3wordchant for the idea :)
This commit is contained in:
parent
a23e16d632
commit
fe7aace9d7
@ -59,6 +59,12 @@ services:
|
|||||||
target: /docker-entrypoint.sh
|
target: /docker-entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
command: npm start
|
command: npm start
|
||||||
|
healthcheck:
|
||||||
|
test: 'nodejs -e "http.get(''http://localhost:9000/api/v1/ping'', (res) => { console.log(''status: '', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });"'
|
||||||
|
interval: 1m
|
||||||
|
timeout: 30s
|
||||||
|
retries: 3
|
||||||
|
start_period: 1m
|
||||||
entrypoint: /docker-entrypoint.sh
|
entrypoint: /docker-entrypoint.sh
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
Loading…
Reference in New Issue
Block a user