Skip to content

Commit f42a099

Browse files
wolfieschclaude
andcommitted
fix(docker): use socket-based health check with netcat
Replace broken 'status' command with netcat socket health check. Added netcat-openbsd to runtime dependencies. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d104b42 commit f42a099

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ RUN touch src/main.rs && cargo build --release
2828
# Stage 2: Minimal runtime image
2929
FROM debian:bookworm-slim
3030

31-
# Install only CA certificates for HTTPS
31+
# Install CA certificates and netcat for health checks
3232
RUN apt-get update && apt-get install -y \
3333
ca-certificates \
34+
netcat-openbsd \
3435
&& rm -rf /var/lib/apt/lists/*
3536

3637
# Create non-root user for security
@@ -48,9 +49,9 @@ WORKDIR /home/fgp
4849

4950
ENV FGP_SOCKET_DIR=/home/fgp/.fgp/services
5051

51-
# Health check
52-
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
53-
CMD fgp-github status || exit 1
52+
# Health check via socket
53+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
54+
CMD echo '{"id":"hc","v":1,"method":"health","params":{}}' | nc -U /home/fgp/.fgp/services/github/daemon.sock | grep -q '"ok":true'
5455

5556
# Mount point for socket (token passed via env var GITHUB_TOKEN)
5657
VOLUME ["/home/fgp/.fgp/services"]

0 commit comments

Comments
 (0)