Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Firebase App Hosting
plat_web
Firebase App Hosting đơn giản hoá việc phát triển và triển khai các ứng dụng web động, cung cấp tính năng tích hợp GitHub và tích hợp với các sản phẩm Firebase khác như Authentication, Cloud Firestore và Firebase AI Logic.
App Hosting tích hợp sẵn tính năng hỗ trợ được định cấu hình trước cho Next.js và Angular, cũng như hỗ trợ rộng hơn cho nhiều khung web phổ biến.
Bạn chỉ cần một thay đổi git để triển khai phiên bản mới của ứng dụng. App Hosting có thể tự động triển khai mỗi khi bạn đẩy vào một nhánh cụ thể.
Được Google Cloud hỗ trợ
App Hosting sử dụng Điều khoản dịch vụ của Google Cloud và triển khai ứng dụng của bạn cho các sản phẩm Google Cloud mà bạn tin tưởng. Ứng dụng được tạo bằng Cloud Build, được phân phát trên Cloud Run và lưu vào bộ nhớ đệm trong Cloud CDN.
Các dịch vụ tích hợp như Trình quản lý bí mật trên đám mây giúp bảo mật khoá API của bạn.
Ra mắt các tính năng dựa trên AI trên quy mô lớn
Bắt đầu với các mẫu AI sử dụng Gemini.
Bảo vệ khoá API của điểm cuối API bằng Trình quản lý bí mật trên đám mây và tận dụng tính năng hỗ trợ truyền trực tuyến của Dịch vụ lưu trữ ứng dụng để duy trì thời gian tải ban đầu nhanh khi bạn thêm các tính năng AI tạo sinh vào ứng dụng.
Tích hợp bảng điều khiển Firebase
Theo dõi các bản dựng và bản phát hành trong bảng điều khiển Firebase để bạn luôn biết những gì đang diễn ra. Truy cập vào nhật ký và chỉ số, thêm miền tuỳ chỉnh và kích hoạt bản phát hành theo cách thủ công từ bảng điều khiển Firebase.
Tính năng này hoạt động như thế nào?
Sử dụng bảng điều khiển Firebase hoặc CLI Firebase, uỷ quyền và cài đặt ứng dụng GitHub Firebase trên kho lưu trữ của bạn.
Vẫn trong bảng điều khiển Firebase hoặc CLI Firebase, hãy tạo một phần phụ trợ Firebase App Hosting, với kho lưu trữ và nhánh trực tiếp để triển khai liên tục.
App Hosting tạo một chính sách triển khai mặc định để phần phụ trợ của bạn triển khai ngay 100% lưu lượng truy cập khi một thay đổi được đẩy vào nhánh mục tiêu.
Khi một thay đổi được đẩy vào nhánh đang hoạt động, Google Cloud Developer Connect sẽ gửi một sự kiện đến Firebase App Hosting.
Để phản hồi sự kiện này, Firebase App Hosting sẽ tạo một bản dựng mới cho phần phụ trợ được kết nối với kho lưu trữ.
Trước tiên, Firebase App Hosting sẽ tạo một bản dựng Cloud Build mới cho
tệp cam kết của bạn. Trong công việc này, gói bản dựng Google Cloud sẽ xác định khung nào đang được sử dụng trong ứng dụng của bạn để tạo một vùng chứa và cấu hình (bao gồm các biến môi trường, thông tin bảo mật, thực thể tối thiểu hoặc tối đa, bộ nhớ đồng thời, CPU và cấu hình VPC) phù hợp với ứng dụng của bạn.
Hãy xem quy trình xây dựng App Hosting để biết thêm thông tin.
Khi công việc Cloud Build hoàn tất, vùng chứa của bạn sẽ được lưu trữ trong một kho lưu trữ Artifact Registry dành riêng cho Firebase App Hosting.
Sau đó, Firebase App Hosting sẽ thêm Bản sửa đổi Cloud Run mới vào dịch vụ Cloud Run bằng hình ảnh và cấu hình của bạn.
Sau khi Bản sửa đổi Cloud Run hoàn tất và được xác minh là hoạt động tốt, Firebase App Hosting sẽ sửa đổi cấu hình lưu lượng truy cập để trỏ tất cả các yêu cầu mới đến Bản sửa đổi Cloud Run mới. Tại thời điểm này, quá trình triển khai đã hoàn tất.
Khi một yêu cầu được gửi đến một trang web được lưu trữ trên Firebase App Hosting, yêu cầu đó sẽ được Trình cân bằng tải của Google Cloud phân phát khi bật Cloud CDN.
Các yêu cầu không được lưu vào bộ nhớ đệm sẽ được gửi đến dịch vụ Cloud Run.
Đường dẫn triển khai
Thiết lập Firebase
Nếu bạn chưa có, hãy tạo một dự án Firebase và đảm bảo dự án đó đã bật gói giá linh hoạt.
Thiết lập App Hosting
Với bảng điều khiển Firebase hoặc CLI Firebase, hãy tạo một phần phụ trợ App Hosting. Đây là tập hợp các tài nguyên được quản lý cho ứng dụng của bạn, bao gồm cả kết nối với kho lưu trữ GitHub cho ứng dụng.
Quản lý và giám sát ứng dụng
Khi hoàn tất việc tạo phần phụ trợ App Hosting, ứng dụng của bạn sẽ có sẵn trên miền con miễn phí và bạn có thể xem thông tin chi tiết về việc triển khai trong bảng điều khiển Firebase. Bạn có thể sử dụng bảng điều khiển Google Cloud để xem và tìm kiếm trong nhật ký.
Phát triển ứng dụng
App Hosting tự động bắt đầu một bản phát hành mới mỗi khi một thay đổi được đẩy vào nhánh đang hoạt động.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-08 UTC."],[],[],null,["Firebase App Hosting \nplat_web \n\nFirebase App Hosting streamlines the development and deployment of dynamic\nweb apps, offering GitHub integration and integration with other Firebase\nproducts like Authentication, Cloud Firestore, and Firebase AI Logic.\nApp Hosting has built-in, preconfigured support for Next.js and Angular\nas well as broader support for various popular web frameworks.\n\n[Get started](/docs/app-hosting/get-started)\n\nKey capabilities\n\n|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| GitHub integration | A git commit is all that's needed to roll out a new version of your app. App Hosting can automatically deploy every time you push to a specific branch. |\n| Backed by Google Cloud | App Hosting uses Google Cloud Terms of Service, and deploys your app to Google Cloud products you trust. Apps are built with Cloud Build, served on Cloud Run, and cached in Cloud CDN. Integrated services like Cloud Secret Manager keep your API keys safe. |\n| Ship AI-powered features at scale | Start with AI samples that use Gemini. Protect your API endpoint's API key with Cloud Secret Manager and leverage App Hosting's streaming support to maintain fast initial load times as you add generative AI features into your app. |\n| Firebase console integration | Monitor your builds and rollouts in the Firebase console so you always know what's going on. Access logs and metrics, add a custom domain, and manually trigger rollouts from the Firebase console. |\n\nHow does it work?\n\n1. Using the Firebase console or Firebase CLI, authorize and install the Firebase GitHub app on your repository.\n2. Still in the Firebase console or Firebase CLI, create a Firebase App Hosting backend, with a repository and live branch for continuous deployment. App Hosting creates a default rollout policy for your backend to roll out to 100% of traffic immediately when a change is pushed to the target branch.\n3. When a commit is pushed to your live branch, Google Cloud Developer Connect sends an event to Firebase App Hosting.\n4. Responding to this event, Firebase App Hosting creates a new build for the backend connected to the repository.\n 1. First, Firebase App Hosting creates a new Cloud Build build for your commit. In this job, [Google Cloud buildpacks](https://cloud.google.com/docs/buildpacks/overview) determine which framework is being used in your application to create a container and configuration (including environment variables, secrets, minimum or maximum instances, concurrency memory, CPU, and VPC configuration) that suits your application. See [the App Hosting build process](/docs/app-hosting/build) For more information.\n 2. When the Cloud Build job is complete, your container is stored in an Artifact Registry repository dedicated to Firebase App Hosting. Firebase App Hosting then adds a new Cloud Run Revision to a Cloud Run service using your image and configuration.\n5. Once your Cloud Run Revision is complete and verified healthy, Firebase App Hosting modifies its traffic configuration to point all new requests to your new Cloud Run Revision. At this point, the rollout is complete.\n6. When a request is sent to a website hosted on Firebase App Hosting, the request is served by Google Cloud Load Balancer with Cloud CDN enabled. Uncached requests are sent to your Cloud Run service.\n\nImplementation path\n\n|---|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Set up Firebase | If you don't already have one, create a Firebase project and make sure it has the Blaze pricing plan enabled. |\n| | Set up App Hosting | With the Firebase console or the Firebase CLI, create an App Hosting backend. This is the collection of managed resources for your app, including the connection to the GitHub repository for your app. |\n| | Manage and monitor your app | When you finish creating an App Hosting backend, your app is available on its free subdomain, and you can view details about the rollout in the Firebase console. You can use the [Google Cloud console](https://console.cloud.google.com/logs/query?project=_) to view and search through your logs. |\n| | Develop your app | App Hosting automatically starts a new rollout every time a commit is pushed to your live branch. |\n\nNext steps\n\n- [Get started](/docs/app-hosting/get-started) deploying apps.\n- Try an App Hosting codelab that integrates a hosted app with Firebase Authentication and Google AI features: [Next.js](https://firebase.google.com/codelabs/firebase-nextjs) \\| [Angular](https://firebase.google.com/codelabs/firebase-web).}\n- Learn more about the various [community-supported frameworks](https://firebaseopensource.com/platform/app_hosting) supported by App Hosting."]]