{"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",],},]}
[null,null,["最后更新时间 (UTC):2025-08-12。"],[],[],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)."]]