Deploying to Google Cloud Run: A Practical First Deploy
During Bangkit Academy I deployed backend services to Google Cloud Platform for the first time. Cloud Run quickly became my favourite way to ship a containerised app without managing servers.
The mental model
Cloud Run runs your container and scales it from zero to many based on traffic. You only pay while requests are being served. Your job is to give it a container that listens on the port in $PORT.
The happy path
- Write a
Dockerfilethat builds and starts your app. - Build and push the image to Artifact Registry.
- Deploy with
gcloud run deployand pick a region.
gcloud run deploy my-service \
--source . \
--region asia-southeast2 \
--allow-unauthenticated
What surprised me
Cold starts are real but small for lightweight services, and wiring Cloud SQL needs the connector configured — not just a connection string.