Orderly shutdown on SIGHUP too, forced exit when stuck; version in the image

SIGINT, SIGTERM and SIGHUP all shut the node down in order (SIGTERM is what a
Kubernetes pod termination sends). A second signal, or 20 seconds (below the
30 s Kubernetes grants), stops the process at once, so a stuck shutdown cannot
hang.

The binary knows its version (allmende version, and the 'node running' log
line); the image is built with the commit as version and 'make image' pushes it
tagged with that commit, refusing a dirty tree.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 13:08:14 +01:00
co-authored by Claude Sonnet 5.5
parent 7120959cb8
commit 0cfb59c469
5 changed files with 88 additions and 4 deletions
+2 -1
View File
@@ -23,7 +23,8 @@ WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/allmende ./cmd/allmende
ARG VERSION=dev
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o /out/allmende ./cmd/allmende
FROM alpine:3.22
RUN adduser -D -u 10001 allmende && mkdir /data && chown allmende /data