대부분의 경우 Firebase Console에서 자동 출시 또는 수동으로 트리거된 출시를 사용하는 것이 좋습니다. 하지만 더 맞춤화된 배포 흐름이 필요할 수도 있습니다. App Hosting에는 맞춤 배포를 위한 여러 옵션이 있습니다.
Firebase CLI를 사용하여 소스에서 배포
Firebase CLI를 사용하면 로컬 머신에서 Firebase로 앱의 소스 코드와 구성을 직접 푸시할 수 있습니다. 다른 Firebase 배포 (예: 보안 규칙 또는 함수)가 있고 단일 CLI 명령어로 웹 앱과 백엔드 서비스를 함께 배포하려는 경우에 유용합니다.
배포 시 App Hosting는 소스 코드를 Google Cloud Storage 버킷에 업로드하고, Cloud Build에서 프레임워크 빌드 명령어를 실행하고, 최종 아티팩트를 Cloud Run 및 Cloud CDN에 배포합니다. App Hosting는 GitHub 배포와 마찬가지로 로컬 소스 배포에도 동일한 빌드 프로세스를 사용합니다. 프로젝트에 .gitignore 파일이 있으면 나열된 파일과 폴더가 배포에서 제외됩니다.
로컬 소스에서 앱을 배포하려면 다음 안내를 따르세요.
로컬 프로젝트 디렉터리에서 firebase init apphosting를 실행합니다.
프롬프트에서 기존 프로젝트 사용을 선택한 다음 선택한 Firebase 프로젝트를 선택합니다.
배포할 새 백엔드 또는 기존 백엔드를 선택합니다. 이 단계에서는 로컬 디렉터리의 App Hosting 배포를 설정하여 앱을 성공적으로 배포하는 데 필요한 정보 App Hosting를 묻는 메시지를 표시합니다.
배포할 백엔드의 ID
배포할 리전 (새 백엔드를 만드는 경우)
애플리케이션 코드의 루트 디렉터리 경로
App Hosting는 firebase.json에 배포 환경설정을 저장합니다 (파일이 없는 경우 로컬 프로젝트에 파일을 만듦). 초기화가 완료되면 firebase deploy를 실행하여 소스 코드를 App Hosting에 배포할 수 있습니다.
여러 백엔드에 대해 로컬 소스 배포가 설정되어 있는 경우 (즉, firebase.json에 backendId 항목이 여러 개 있는 경우) firebase deploy는 이러한 각 백엔드에 배포됩니다. 특정 백엔드에 배포하려면 firebase deploy --only apphosting:backendId를 사용합니다.
firebase.json 예
{"apphosting":[{"backendId":"my-backend",// rootDir specifies the directory containing the app to deploy, but the entire// parent directory of firebase.json will be zipped and uploaded to ensure that// dependencies outside of the app directory will be available at build time."rootDir":"./my-app","ignore":["node_modules",".git","firebase-debug.log","firebase-debug.*.log","functions",],},]}
Terraform을 사용하여 배포
빌드 프로세스와 배포된 환경을 더 세부적으로 제어해야 하는 경우 Terraform을 사용하여 배포할 수 있습니다. Terraform을 사용하면 선언적 구성 파일을 사용하여 App Hosting 리소스를 정의하고 관리할 수 있으며, App Hosting가 소스 코드에서 빌드하는 대신 미리 빌드된 자체 컨테이너 이미지를 App Hosting에 직접 배포할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-31(UTC)"],[],[],null,["\u003cbr /\u003e\n\nMost of the time, we recommend using [automatic rollouts](/docs/app-hosting/rollouts) or\n[manually-triggered rollouts](/docs/app-hosting/rollouts#manually-trigger)\nfrom the Firebase console. However, you may have a use for a more customized\ndeployment flow. App Hosting has multiple options for custom deployment.\n\nDeploy from source with the Firebase CLI\n\nThe Firebase CLI lets you push your app's source code and configuration\ndirectly from your local machine to Firebase. This is convenient if you have\nother Firebase deployments (such as security rules or functions) and want to\ndeploy your web app and backend services together with a single CLI command.\n\nOn deployment, App Hosting uploads your source code to a Google Cloud\nStorage bucket, runs your framework build command in Cloud Build, and deploys\nthe final artifacts to Cloud Run and Cloud CDN. App Hosting uses the same\n[build process](/docs/app-hosting/build) for local source deployments as\nGitHub deployments. If you have a `.gitignore` file in your project, the files\nand folders it lists are excluded from your deployment.\n| **Note:** Make sure you have a project on the Blaze Pay-as-you-go plan.\n\nTo deploy your app from local source:\n\n1. Run `firebase init apphosting` in your local project directory.\n2. At the prompt, select **Use an existing project**, and then select the chosen Firebase project.\n3. Select either a new or existing backend to deploy to; this step sets up App\n Hosting deployments for your local directory, prompting you for the\n information App Hosting needs to successfully deploy your app:\n\n 1. The ID of the backend to deploy to\n 2. The region to deploy to (if creating a new backend)\n 3. The path to the root directory of the application code\n\n App Hosting saves your deployment preferences in `firebase.json` (creating\n the file in your local project if it doesn't exist). Once initialization\n completes successfully, you can run `firebase deploy` to deploy your source\n code to App Hosting.\n\nIf you have local source deployments set up for multiple backends (meaning there\nare multiple `backendId` entries in `firebase.json`), `firebase deploy` will\ndeploy to each of those backends. To deploy to a specific backend, use\n`firebase deploy --only apphosting:backendId`\n\nExample firebase.json \n\n {\n \"apphosting\": [\n {\n \"backendId\": \"my-backend\",\n // rootDir specifies the directory containing the app to deploy, but the entire\n // parent directory of firebase.json will be zipped and uploaded to ensure that\n // dependencies outside of the app directory will be available at build time.\n \"rootDir\": \"./my-app\",\n \"ignore\": [\n \"node_modules\",\n \".git\",\n \"firebase-debug.log\",\n \"firebase-debug.*.log\",\n \"functions\",\n ],\n },\n ]\n }\n\nDeploy using Terraform\n\nIf you need greater control over the build process and deployed environment, you\ncan deploy using Terraform. Terraform lets you define and manage your\nApp Hosting resources using declarative configuration files, and provides\nthe ability to deploy your own prebuilt container image directly to\nApp Hosting instead of relying on App Hosting to build from your source\ncode.\n\nIf you're new to Terraform, see\n[Get started with Terraform and Firebase](/docs/projects/terraform/get-started).\nIf you're already familiar with\nTerraform, you can get started with sample configuration files and other\n[App Hosting resources](/docs/projects/terraform/get-started#resources-app-hosting).\n\nDeploy using Firebase Studio\n\nWhen you create a web app with the App Prototyping agent in Firebase Studio,\nyou can publish, or deploy, to Firebase App Hosting directly from\nFirebase Studio. See [Publish your app with App Hosting](/docs/studio/deploy-app#publish)."]]