Skip to content

Commit

Permalink
Merge pull request #4 from remcoros/restart-on-crash
Browse files Browse the repository at this point in the history
remove public-pool patch in favor or restarting the container when th…
  • Loading branch information
remcoros authored Oct 4, 2024
2 parents a3c456b + c0caab5 commit db50f97
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 73 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ RUN \
# apply patch for rpc-bitcoin (see: https://github.com/vansergen/rpc-bitcoin/pull/65)
COPY patches/rpc-bitcoin+2.0.0.patch /build/public-pool/patches/rpc-bitcoin+2.0.0.patch

# Apply patches not included in upstream repo (yet)
COPY patches/public-pool.patch /build/public-pool/public-pool.patch
RUN \
cd public-pool && \
git apply public-pool.patch

RUN \
cd public-pool && \
npm ci && \
Expand Down
13 changes: 11 additions & 2 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,21 @@ app_process=$!
nginx -g "daemon off;" &
proxy_process=$!

# hook the TERM signal and wait for all our processes
# hook the TERM signal and wait
_term() {
echo "Caught TERM signal!"
kill -TERM "$proxy_process" 2>/dev/null
kill -TERM "$app_process" 2>/dev/null
}

trap _term TERM
wait $app_process $proxy_process

# wait for one of the processes to finish (or crash)
wait -n $app_process $proxy_process
status=$?

# terminate the rest of processes
kill -TERM "$proxy_process" 2>/dev/null
kill -TERM "$app_process" 2>/dev/null

exit $status
65 changes: 0 additions & 65 deletions patches/public-pool.patch

This file was deleted.

0 comments on commit db50f97

Please sign in to comment.