From ca9990e4f7dc8555774ba1b347371c2e3ed87907 Mon Sep 17 00:00:00 2001 From: Jim Scardelis Date: Sun, 29 Mar 2026 19:32:03 -0700 Subject: [PATCH 1/2] fix: replace false-positive health check with process check The previous health check (npm list -g @playwright/mcp) only verified the package was installed, not that the server was running. A crashed MCP process would still report the container as healthy. Replace with pgrep to verify the @playwright/mcp process is actually running. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9e93266..f256676 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,5 +28,9 @@ RUN mkdir -p /home/playwright/.npm && chown -R playwright:playwright /home/playw # Switch to non-root user USER playwright +# Add health check to monitor container health +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD pgrep -f "@playwright/mcp" > /dev/null || exit 1 + # Set the entrypoint ENTRYPOINT ["/app/entrypoint.sh"] From ba26fbb440b404d191c725bef4eceab863ebba5e Mon Sep 17 00:00:00 2001 From: Jim Scardelis Date: Sun, 29 Mar 2026 19:35:19 -0700 Subject: [PATCH 2/2] fix: bind MCP server to 0.0.0.0 so Docker port forwarding works @playwright/mcp defaults to binding on localhost (127.0.0.1) inside the container. Docker forwards traffic to the container's eth0 IP, not loopback, so all client connections got ECONNRESET. Pass --host 0.0.0.0 alongside --port so the server listens on all interfaces and is reachable from outside the container. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index af00025..e7a9207 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,10 +11,10 @@ if [ "$HEADLESS" = "true" ]; then MCP_ARGS="$MCP_ARGS --headless" fi -# Add --port if MCP_PORT is set (for SSE connection) -# This allows SSE connection even when HEADLESS=true +# Add --port and --host if MCP_PORT is set (for SSE connection) +# --host 0.0.0.0 is required so Docker port forwarding can reach the server if [ -n "$MCP_PORT" ]; then - MCP_ARGS="$MCP_ARGS --port $INTERNAL_PORT" + MCP_ARGS="$MCP_ARGS --port $INTERNAL_PORT --host 0.0.0.0" fi # Add --isolated if ISOLATED environment variable is true