What problem does it solve?
Running Puppeteer on Cloud Run fails silently when gen1, missing Chrome libraries, or misconfigured secret mounts block headless Chrome; this guide pinpoints the correct environment, dependencies, and launch settings to fix that.
Core Features & Use Cases
- Gen2 Execution Environment: Force Cloud Run gen2 to avoid gVisor restrictions that hang Chrome.
- System Dependency Installation: Install the exact apt packages so Puppeteer can launch without missing libraries.
- Secret Manager Mounting: Mount service account secrets outside the WORKDIR and expose a stable environment variable instead of relying on CLI path conversions.
- Puppeteer Launch & Timing: Use headless 'new', extended timeouts, Chrome flags, request interception, and valid waitUntil modes to stream content from distant servers while blocking heavy assets.
- Deployment Command Template: Apply the recommended gcloud deploy command with gen2, 2Gi RAM, generous timeout, and secret mounts to keep the Chrome process healthy.
Quick Start
Deploy a Node.js Puppeteer service to Cloud Run gen2 with the required Chrome libraries, a separate secret mount path, and tuned launch arguments for reliable headless execution.