1.8 KiB
1.8 KiB
GCP Deployment Scripts
Minimal container deployment for Clawdbot on Google Cloud Platform.
Quick Start
# 1. Create a NEW GCP project and enable APIs
./setup-project.sh clawdbot-$(date +%Y%m%d) us-east1
# 2. Store secrets (interactive)
./store-secrets.sh
# 3. Build and push production image
./build-push.sh local # Build locally, push to GCR
./build-push.sh cloud # Build on Cloud Build (no local Docker)
# 4. Deploy
./deploy-vm.sh # Compute Engine (free tier: e2-micro)
./deploy-vm.sh e2-small # Compute Engine with more RAM
./deploy-cloudrun.sh # Cloud Run (pay per request)
# 5. Connect
./connect.sh # IAP tunnel to Gateway
./ssh.sh # SSH into VM
./logs.sh --follow # View container logs
Cost Comparison
| Option | Monthly Cost | Notes |
|---|---|---|
| e2-micro VM | $0 (free tier) | 1 vCPU shared, 1GB RAM, always on |
| e2-small VM | ~$13/mo | 2 vCPU shared, 2GB RAM |
| Cloud Run | ~$0-5/mo | Pay per request, auto-scales to 0 |
Files
setup-project.sh- Enable APIs, create service account, firewall rulesstore-secrets.sh- Store API keys in Secret Managerbuild-push.sh- Build production image and push to GCRdeploy-vm.sh- Deploy to Compute Engine with containerdeploy-cloudrun.sh- Deploy to Cloud Runconnect.sh- IAP tunnel to Gateway portssh.sh- SSH into VM via IAPlogs.sh- View container logs
Production Image
Uses Dockerfile.production (multi-stage build):
- Builder stage: Full Node.js + Bun for compilation
- Production stage:
node:22-bookworm-slim(~150-200MB final) - Runs as non-root user
- Health check endpoint
Security
- No public IP (access via IAP tunnel)
- Secrets stored in Secret Manager
- Dedicated service account with minimal permissions
- Shielded VM with Secure Boot