mirror of
https://github.com/willfarrell/docker-autoheal.git
synced 2024-12-06 19:16:20 +01:00
5b99d0280f
Updated Dockerfile and scripts with some of the latest PR's, and work from tylerpace. Adding a few files back from original repo such as tests and github workflow. Co-Authored-By: Tyler Pace <4195596+tylerpace@users.noreply.github.com>
58 lines
1.3 KiB
YAML
Executable File
58 lines
1.3 KiB
YAML
Executable File
version: '3.7'
|
|
|
|
services:
|
|
|
|
should-keep-restarting:
|
|
# this container should be restarted by autoheal because its unhealthy and has the autoheal label
|
|
image: alpine
|
|
network_mode: none
|
|
restart: "no"
|
|
labels:
|
|
- "$AUTOHEAL_CONTAINER_LABEL=true"
|
|
healthcheck:
|
|
test: exit 1
|
|
interval: 3s
|
|
timeout: 1s
|
|
retries: 3
|
|
start_period: 5s
|
|
command: tail -f /dev/null
|
|
|
|
shouldnt-restart-healthy:
|
|
# this container shouldn't be restarted by autoheal because its healthy
|
|
image: alpine
|
|
network_mode: none
|
|
restart: "no"
|
|
labels:
|
|
- "$AUTOHEAL_CONTAINER_LABEL=true"
|
|
healthcheck:
|
|
test: exit 0
|
|
interval: 2s
|
|
timeout: 1s
|
|
retries: 1
|
|
start_period: 1s
|
|
command: tail -f /dev/null
|
|
|
|
shouldnt-restart-no-label:
|
|
# this container shouldn't be restarted by autoheal because its missing the autoheal label
|
|
image: alpine
|
|
network_mode: none
|
|
restart: "no"
|
|
healthcheck:
|
|
test: exit 1
|
|
interval: 3s
|
|
timeout: 1s
|
|
retries: 1
|
|
start_period: 5s
|
|
command: tail -f /dev/null
|
|
|
|
autoheal:
|
|
build:
|
|
context: ../
|
|
restart: unless-stopped
|
|
environment:
|
|
AUTOHEAL_CONTAINER_LABEL: "${AUTOHEAL_CONTAINER_LABEL:-all}"
|
|
AUTOHEAL_INTERVAL: "10"
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
network_mode: none
|