You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QueryPal is designed for Google Cloud Run with automatic CI/CD:
294
+
QueryPal runs on Google Cloud Run with a private backend topology. The frontend nginx container is the only public entry point — the backend service is network-isolated and unreachable from the internet.
294
295
295
-
#### Automatic Deployment
296
-
1.**Push to Production**: Commits to `production` branch trigger automatic deployment
297
-
2.**GitHub Actions**: Builds and deploys both frontend and backend containers
298
-
3.**Environment Variables**: Securely managed through GitHub Secrets
296
+
```mermaid
297
+
graph TB
298
+
Browser(["👤 Browser"])
299
+
300
+
subgraph gcp["☁️ Google Cloud Platform — europe-west1"]
SM -- "mounted at startup\nvia --set-secrets" --> Backend
332
+
SA -. "identity" .-> Frontend
333
+
SA -. "identity" .-> Backend
334
+
GCR -- "image" --> Frontend
335
+
GCR -- "image" --> Backend
336
+
```
337
+
338
+
### Network Security Model
339
+
340
+
|| Frontend | Backend |
341
+
|---|---|---|
342
+
|**Cloud Run ingress**|`all` (public) |`internal` (VPC only) |
343
+
|**VPC egress**|`all-traffic` (proxy to backend) |`private-ranges-only`|
344
+
|**Internet accessible**| ✅ Yes | ❌ No — 403 from GFE |
345
+
|**Who can call it**| Anyone | Frontend nginx via VPC connector |
346
+
347
+
All API calls from the browser go to `/api/*` on the frontend's own origin. Nginx strips the `/api` prefix and proxies the request to the backend's internal Cloud Run URL through the VPC connector. The backend URL is never exposed to the browser.
348
+
349
+
### Secret Management
350
+
351
+
All sensitive configuration is stored in **GCP Secret Manager** and mounted into the backend container at startup via Cloud Run's native `--set-secrets` integration. Secrets are never passed as plain environment variables and never appear in deployment logs or `gcloud run describe` output.
352
+
353
+
| Secret | Description |
354
+
|---|---|
355
+
|`querypal-azure-tenant-id`| Microsoft Entra ID tenant |
356
+
|`querypal-azure-client-id`| Backend app registration client ID |
Cloud infrastructure is managed by **Terraform** in the `terraform/` directory. The CI pipeline owns image builds and Cloud Run deployments; Terraform owns everything underneath.
> See the PR migration guide for the full step-by-step checklist, including how to populate Secret Manager values and what to verify before the first production deploy.
384
+
385
+
### CI/CD Pipeline
386
+
387
+
Pushes to the `production` branch trigger the deploy workflow (`.github/workflows/google-cloudrun-docker.yml`).
QueryPal also supports deployment to Azure Web Apps using the included publish profiles.
410
+
Workload Identity Federation is used for keyless authentication — no long-lived service account keys are stored in GitHub. The dedicated Cloud Run service account (`querypal-cloudrun-sa`) holds only the permissions it needs: `secretmanager.secretAccessor`, `cloudsql.client`, and `vpcaccess.user`.
0 commit comments