File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 4040 echo "alias l='ls -altr'" >> /root/.bashrc
4141COPY --from=build-backend /snmpcollector/ /snmpcollector/
4242WORKDIR /snmpcollector
43- HEALTHCHECK --interval=10s --retries=1 CMD /bin/bash -c "[ ! -f /tmp/fail_health_check ]"
43+ # check for "fail" file and if it exists, remove it and fail the check:
44+ HEALTHCHECK --interval=10s --retries=1 CMD /bin/bash -c "[ ! -f /tmp/fail_health_check ] || ( rm /tmp/fail_health_check && exit 1 )"
4445CMD ["python" , "-m" , "snmpcollector" ]
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ services:
4747 container_name : autoheal-snmp
4848 environment :
4949 - AUTOHEAL_CONTAINER_LABEL=all
50+ - AUTOHEAL_INTERVAL=5 # check every 5 seconds - this must be lower than the period of Docker container HEALTHCHECK we are monitoring
5051 volumes :
5152 - /var/run/docker.sock:/var/run/docker.sock
5253 restart : always
You can’t perform that action at this time.
0 commit comments