Skip to content

Serverless Containers

Key idea:

Serverless Containers — run Docker images in a managed environment with per-request/per-second billing and scale-to-zero. Unlike Lambda (short request, small bundle) they support long-running workloads, more RAM/CPU, any language or binary. Google Cloud Run, AWS ECS Fargate (with Fargate Spot), Azure Container Apps, Fly.io Machines. Ideal for API servers, background jobs, AI inference (with GPU).

Below: details, example, related terms, FAQ.

Try it now — free →

Details

  • Cloud Run: HTTP/gRPC triggers, 60 min/request max, scale 0→1000 in seconds
  • Fargate: deeper ECS integration, slower scale (tens of seconds)
  • Fly.io Machines: per-machine control, great for stateful apps, 35 regions
  • Azure Container Apps: KEDA scaling, DAPR sidecar, Event Grid triggers
  • Cold start: 1-5 s (vs 100-500 ms for Lambda, vs 0 ms for edge V8 Isolates)

Example

# Deploy a Docker image to Cloud Run
$ gcloud run deploy api \
    --image=gcr.io/project/app:v1 \
    --min-instances=0 \
    --max-instances=100 \
    --memory=1Gi \
    --cpu=1 \
    --timeout=300 \
    --concurrency=80

Related

Learn more

Frequently Asked Questions

When serverless container vs Lambda?

Container: long-running, large bundle, GPU, exotic language. Lambda: fast HTTP APIs (<30 s), tight bundle, native Node/Python/Go.

Is scale-to-zero risky?

Low-traffic APIs — no (2 s cold-start is fine). Real-time — keep min-instances >= 1.

Cheapest option for long-running?

Fly.io Machines — $2/month for 256 MB / shared CPU. Cloud Run — pay-per-request, worst when idle.