File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 40
40
echo "alias l='ls -altr'" >> /root/.bashrc
41
41
COPY --from=build-backend /snmpcollector/ /snmpcollector/
42
42
WORKDIR /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 )"
44
45
CMD ["python" , "-m" , "snmpcollector" ]
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ services:
47
47
container_name : autoheal-snmp
48
48
environment :
49
49
- 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
50
51
volumes :
51
52
- /var/run/docker.sock:/var/run/docker.sock
52
53
restart : always
You can’t perform that action at this time.
0 commit comments