<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh" -->

---
title: Build and Deploy a Dockerized NestJS Application on...
description: This tutorial walks through building a Docker image for a NestJS app and deploying it on Google Cloud Run. It covers setting up a NestJS project with the...
canonical: https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Build and Deploy a Dockerized NestJS Application on Google Cloud Run | daily.dev
og:description: This tutorial walks through building a Docker image for a NestJS app and deploying it on Google Cloud Run. It covers setting up a NestJS project with the...
og:url: https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh
og:image: https://api.daily.dev/og/posts/7Tj17OhXH.png
og:image:alt: Build and Deploy a Dockerized NestJS Application on Google Cloud Run
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Build and Deploy a Dockerized NestJS Application on Google Cloud Run

**[Telerik](https://daily.dev/sources/telerik)** · 10 min read · 0 upvotes · 0 comments

## Summary

This tutorial walks through building a Docker image for a NestJS app and deploying it on Google Cloud Run. It covers setting up a NestJS project with the config module for environment variables, writing a multi-stage Dockerfile that installs pnpm and builds the app, and tagging and pushing the image to Docker Hub with a command like 'docker build . -f Dockerfile --platform linux/amd64 -t chrisnw/dummy-app:0002'. It then shows deploying the image through the Cloud Run console, choosing request-based versus instance-based billing, setting environment variables and secrets, and redeploying after a code change.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.telerik.com/blogs/build-deploy-dockerized-nestjs-application-google-cloud-run>

## Questions this post answers

### How do I deploy a Dockerized NestJS app to Google Cloud Run?

Build the image locally with Docker using a multi-stage Dockerfile (pnpm install and build in one stage, copy node_modules and dist into a slim node:22-alpine runner), push it to a registry like Docker Hub with 'docker push <username>/<image>:<tag>', then in Cloud Run choose 'Deploy from a container image', paste the image URL, configure environment variables, and click Create.

_daily.dev surfaces deployment walkthroughs like this one for developers shipping containerized Node services._

### Should I use request-based or instance-based billing for a Google Cloud Run service?

Use request-based billing for low-traffic services since you're only charged per request, but it means instances sleep when idle and can't run background tasks like CRON jobs or queue workers. Instance-based billing with a minimum instance count keeps the server always running and reachable without cold starts, at a higher baseline cost.

_Compare cloud deployment trade-offs like this on daily.dev before committing to a billing model._

### Why do I need to set the --platform linux/amd64 flag when building a Docker image for Google Cloud Run?

Setting '--platform linux/amd64' during 'docker build' ensures the generated image runs correctly on Cloud Run, which is particularly important when building the image on an Apple Silicon machine whose native architecture is arm64, not amd64.

_Developers debugging container platform mismatches check practical fixes like this on daily.dev._

## Similar posts on daily.dev

- [Deploying Containerized NestJS Applications on GCP Using Cloud Run](https://daily.dev/posts/deploying-containerized-nestjs-applications-on-gcp-using-cloud-run-dpuwleooa) · Telerik · 0 upvotes · 0 comments
- [How to Containerize a Node.js Application with Docker and Deploy with GitHub Actions](https://daily.dev/posts/how-to-containerize-a-node-js-application-with-docker-and-deploy-with-github-actions-ndb3pz7zw) · freeCodeCamp · 1 upvotes · 0 comments
- [Run a Dockerfile on Vercel](https://daily.dev/posts/run-a-dockerfile-on-vercel-hn3hhwkoh) · Flavio Copes · 1 upvotes · 0 comments
- [Containerizing Java, Python, and JavaScript Apps - Multi-Stage Docker Builds, Non-Root Users, and Docker Hub Tagging](https://daily.dev/posts/containerizing-java-python-and-javascript-apps---multi-stage-docker-builds-non-root-users-and-do-ancbrg46f) · Medium · 22 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#docker](https://daily.dev/tags/docker), [#containers](https://daily.dev/tags/containers), [#gcp](https://daily.dev/tags/gcp), [#nestjs](https://daily.dev/tags/nestjs)

[View this post on daily.dev](https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Build and Deploy a Dockerized NestJS Application on Google Cloud Run","url":"https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh"},"datePublished":"2026-11-19T00:06:57.688Z","dateModified":"2026-11-19T00:10:30.906Z","description":"This tutorial walks through building a Docker image for a NestJS app and deploying it on Google Cloud Run. It covers setting up a NestJS project with the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e0c33b3df5a77117edefde2ccb2302a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e0c33b3df5a77117edefde2ccb2302a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Telerik","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Telerik","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5ee6d4bef8ac4f84886d06f5881963e7","url":"https://daily.dev/sources/telerik"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,docker,containers,gcp,nestjs","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Telerik","item":"https://daily.dev/sources/telerik"},{"@type":"ListItem","position":3,"name":"Build and Deploy a Dockerized NestJS Application on Google Cloud Run"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/build-and-deploy-a-dockerized-nestjs-application-on-google-cloud-run-7tj17ohxh#faq","mainEntity":[{"@type":"Question","name":"How do I deploy a Dockerized NestJS app to Google Cloud Run?","acceptedAnswer":{"@type":"Answer","text":"Build the image locally with Docker using a multi-stage Dockerfile (pnpm install and build in one stage, copy node_modules and dist into a slim node:22-alpine runner), push it to a registry like Docker Hub with 'docker push \u003cusername\u003e/\u003cimage\u003e:\u003ctag\u003e', then in Cloud Run choose 'Deploy from a container image', paste the image URL, configure environment variables, and click Create. daily.dev surfaces deployment walkthroughs like this one for developers shipping containerized Node services."}},{"@type":"Question","name":"Should I use request-based or instance-based billing for a Google Cloud Run service?","acceptedAnswer":{"@type":"Answer","text":"Use request-based billing for low-traffic services since you're only charged per request, but it means instances sleep when idle and can't run background tasks like CRON jobs or queue workers. Instance-based billing with a minimum instance count keeps the server always running and reachable without cold starts, at a higher baseline cost. Compare cloud deployment trade-offs like this on daily.dev before committing to a billing model."}},{"@type":"Question","name":"Why do I need to set the --platform linux/amd64 flag when building a Docker image for Google Cloud Run?","acceptedAnswer":{"@type":"Answer","text":"Setting '--platform linux/amd64' during 'docker build' ensures the generated image runs correctly on Cloud Run, which is particularly important when building the image on an Apple Silicon machine whose native architecture is arm64, not amd64. Developers debugging container platform mismatches check practical fixes like this on daily.dev."}}]}
```

