feat(docker): add healthcheck and wget dependency

Adds a healthcheck endpoint and updates Dockerfile/README
to include wget and define healthcheck logic.
This commit is contained in:
2026-05-01 03:31:01 +03:00
parent 54bb68642f
commit 25bc095412
4 changed files with 39 additions and 1 deletions

View File

@@ -21,7 +21,11 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o warpbox ./cmd/
# Stage 2: Runtime
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
RUN apk add \
--no-cache \
ca-certificates \
tzdata \
wget
# Create non-root user
RUN addgroup -S warpbox && adduser -S warpbox -G warpbox
@@ -60,6 +64,9 @@ ENV WARPBOX_DATA_DIR=/app/data \
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD wget -qO- http://127.0.0.1:8080/health >/dev/null || exit 1
VOLUME ["/app/data"]
CMD ["./warpbox", "run", "--addr", ":8080"]