Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down