diff --git a/templates/docker-compose.yml b/templates/docker-compose.yml index 7329d86..70e0999 100644 --- a/templates/docker-compose.yml +++ b/templates/docker-compose.yml @@ -25,7 +25,12 @@ services: lemmy: image: {{ lemmy_docker_image }} hostname: lemmy - restart: always + restart: on-failure + healthcheck: #Wget the api root every minute and restart if timeout exceeds 5 seconds + test: ["CMD-SHELL", "wget -S -T 5 --spider -q http://localhost:8536 || exit 1"] #NOTE the wget timeout is seperate from the heathcheck timeout + interval: 1m + timeout: 5s #NOTE the heathcheck timeout is seperate from the wget timeout + retries: 3 logging: *default-logging environment: - RUST_LOG="warn"