High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
chore(docker): pin base images, add healthcheck, improve docs
Boschbc2f2a747b1b
diff --git a/.dockerignore b/.dockerignoreindex 88d885f5..7fb19cdf 100644--- a/.dockerignore+++ b/.dockerignore@@ -10,6 +10,9 @@ coverage.out.git/.github/+# Tests (E2E fixtures, scenarios, results)+tests/+# Local state.pinchtab/.openclaw/@@ -21,9 +24,19 @@ coverage.out.vscode/*.swp-# Docs+# Docs (not needed in image)docs/# Developmentnode_modules/-*.log\ No newline at end of file+dashboard/node_modules/+*.log++# Build caches+.gocache/+.gomodcache/+tmp/++# Markdown (README, RELEASE, etc.)+*.md+!dashboard/**/*.mddiff --git a/Dockerfile b/Dockerfileindex 525c4809..350df365 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,13 +1,17 @@-# Dashboard build stage-FROM oven/bun:latest AS dashboard+# Stage 1: Build the React dashboard with Bun.+# The compiled assets are copied into the Go embed directory in stage 2.+FROM oven/bun:1 AS dashboardWORKDIR /buildCOPY dashboard/package.json dashboard/bun.lock ./RUN bun install --frozen-lockfileCOPY dashboard/ .RUN bun run build-# Go build stage-FROM golang:1.26-alpine AS builder+# Stage 2: Compile the Go binary.+# Dashboard dist is embedded into the binary via Go's embed package.+# The rename to dashboard.html avoids a conflict with the Go embed server's+# own index route — the dashboard handler serves it explicitly.+FROM golang:1.26-alpine3.21 AS builderRUN apk add --no-cache gitWORKDIR /buildCOPY go.mod go.sum ./@@ -17,13 +21,14 @@ COPY --from=dashboard /build/dist/ internal/dashboard/dashboard/RUN mv internal/dashboard/dashboard/index.html internal/dashboard/dashboard/dashboard.htmlRUN go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab-# Runtime stage-FROM alpine:latest+# Stage 3: Minimal runtime image with Chromium.+# Only the compiled binary and entrypoint script are copied in.+FROM alpine:3.21LABEL org.opencontainers.image.source="https://github.com/pinchtab/pinchtab"LABEL org.opencontainers.image.description="High-performance browser automation bridge"-# Install Chromium and dependencies+# Chromium and its runtime dependencies for headless operationRUN apk add --no-cache \chromium \nss \@@ -33,28 +38,26 @@ RUN apk add --no-cache \ttf-freefont \dumb-init-# Create non-root user and persistent config/state directory+# Non-root user; /data is the persistent volume mount pointRUN adduser -D -h /data -g '' pinchtab && \mkdir -p /data && \chown pinchtab:pinchtab /data-# Copy binary from builderCOPY --from=builder /build/pinchtab /usr/local/bin/pinchtabCOPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh-# Switch to non-root userUSER pinchtabWORKDIR /data-# Environment variables+# HOME and XDG_CONFIG_HOME point into the persistent volume so config+# and Chrome profiles survive container restarts.ENV HOME=/data \XDG_CONFIG_HOME=/data/.config-# Expose portEXPOSE 9867-# Use dumb-init to properly handle signals-ENTRYPOINT ["/usr/bin/dumb-init", "--"]+HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \+ CMD wget -q -O /dev/null http://localhost:9867/health || exit 1-# Run pinchtab+ENTRYPOINT ["/usr/bin/dumb-init", "--"]CMD ["/usr/local/bin/docker-entrypoint.sh", "pinchtab"]diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaserindex e64d11f7..0f302866 100644--- a/Dockerfile.goreleaser+++ b/Dockerfile.goreleaser@@ -1,8 +1,12 @@+# Release image — receives a pre-built binary from GoReleaser.+# Mirrors the development Dockerfile runtime stage but uses the release+# entrypoint which also backfills Chrome flags on first boot.FROM alpine:3.21LABEL org.opencontainers.image.source="https://github.com/pinchtab/pinchtab"LABEL org.opencontainers.image.description="Browser control for AI agents"+# Chromium and its runtime dependencies for headless operationRUN apk add --no-cache \chromium \nss \@@ -12,6 +16,7 @@ RUN apk add --no-cache \ttf-freefont \dumb-init+# Non-root user; /data is the persistent volume mount pointRUN adduser -D -g '' pinchtab && \mkdir -p /data && \chown pinchtab:pinchtab /data@@ -22,10 +27,15 @@ COPY --chmod=0755 docker-entrypoint-release.sh /usr/local/bin/docker-entrypoint-USER pinchtabWORKDIR /data+# HOME and XDG_CONFIG_HOME point into the persistent volume so config+# and Chrome profiles survive container restarts.ENV HOME=/data \XDG_CONFIG_HOME=/data/.configEXPOSE 9867+HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \+ CMD wget -q -O /dev/null http://localhost:9867/health || exit 1+ENTRYPOINT ["/usr/bin/dumb-init", "--"]CMD ["/usr/local/bin/docker-entrypoint-release.sh", "pinchtab"]