# Cloud Platforms
Each platform has a deploy script (`deploy_<platform>.sh`) and a
GitHub Actions workflow (`.github/workflows/deploy-<platform>.yml`).
## Google Cloud Run
Cloud Run is the recommended platform — it auto-scales to zero,
supports containers natively, and sets `PORT` automatically.
```bash
./deploy_cloudrun.sh
```
**Key settings:**
- Container port: `PORT` (auto-set by Cloud Run)
- Min instances: `0` (scale to zero)
- Max instances: `100`
- CPU: `1` vCPU (single-process mode)
- Memory: `512 Mi`
- Timeout: `300s`
**Secrets:** Set `GEMINI_API_KEY` via Cloud Run environment variables
or Secret Manager.
## Google App Engine
App Engine Flex runs the same container image.
```bash
./deploy_appengine.sh
```
Configured via `app.yaml` (auto-generated by the deploy script).
## Firebase Hosting
Firebase Hosting can proxy to Cloud Functions, which runs the ASGI
app via a functions adapter.
```bash
./deploy_firebase_hosting.sh
```
## AWS App Runner
App Runner is AWS's equivalent of Cloud Run — container-based,
auto-scaling, fully managed.
```bash
./deploy_aws.sh
```
**Key settings:**
- Port: `8080`
- CPU: `1 vCPU`
- Memory: `2 GB`
- Auto-scaling: `1-25` instances
**Secrets:** Set `GEMINI_API_KEY` via App Runner environment variables
or AWS Secrets Manager.
## Azure Container Apps
Azure Container Apps provides serverless containers with Dapr
integration.
```bash
./deploy_azure.sh
```
**Key settings:**
- Port: `8080`
- CPU: `0.5` cores
- Memory: `1 Gi`
- Min replicas: `0`
- Max replicas: `10`
**Secrets:** Set `GEMINI_API_KEY` via Container Apps secrets.
## Fly.io
Fly.io runs containers globally with edge deployment.
```bash
./deploy_flyio.sh
```
**Key settings:**
- Configured via `fly.toml` (auto-generated by deploy script)
- Auto-scaling based on connections
- Regions configurable via `fly regions add`
**Secrets:**
```bash
fly secrets set GEMINI_API_KEY=<your-key>
```
## Platform comparison
| Feature | Cloud Run | App Engine | App Runner | Container Apps | Fly.io |
|---------|-----------|------------|------------|----------------|--------|
| Scale to zero | Yes | No | Yes | Yes | Yes |
| gRPC support | Yes (HTTP/2) | Partial | No | Yes | Yes |
| Min cost | Free tier | Free tier | ~$5/mo | Free tier | Free tier |
| Cold start | ~2s | ~5s | ~3s | ~3s | ~1s |
| Max timeout | 3600s | 60s | 120s | 600s | Unlimited |
| Global edge | Via CDN | Via CDN | US regions | Limited | Yes |