Skip to content

Commit

Permalink
Add health check
Browse files Browse the repository at this point in the history
Closes: #12
  • Loading branch information
taoky committed Jul 2, 2024
1 parent 33465e8 commit e821f4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docker/rootfs/opt/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

check_process() {
local process_name=$1

if pgrep "$process_name" > /dev/null; then
return 0
else
exit 1
fi
}

check_process "squid"
check_process "nghttpx"
check_process "crond"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ FROM smartentry/alpine:3.18
MAINTAINER Yifan Gao <[email protected]>

COPY .docker $ASSETS_DIR
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 CMD /opt/healthcheck.sh

RUN smartentry.sh build

0 comments on commit e821f4f

Please sign in to comment.