Add healthcheck for docker-compose + autoheal for auto restart

This commit is contained in:
황윤성 2021-10-26 17:14:25 +09:00 committed by GitHub
parent 0cb3404f5c
commit e879a16843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,8 +88,20 @@ services:
https_only: false
domain:
# external_port:
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
interval: 30s
timeout: 5s
retries: 2
depends_on:
- postgres
autoheal:
restart: always
image: willfarrell/autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
postgresdata: