Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Firebase App Hosting
plat_web
Firebase App Hosting ułatwia tworzenie i wdrażanie dynamicznych aplikacji internetowych, oferując integrację z GitHubem i innymi usługami Firebase, takimi jak Authentication, Cloud Firestore i Firebase AI Logic.
App Hosting ma wbudowaną, wstępnie skonfigurowaną obsługę Next.js i Angulara, a także szerszą obsługę różnych popularnych platform internetowych.
Rozpocznij
Najważniejsze funkcje
Integracja z GitHubem |
Aby wdrożyć nową wersję aplikacji, wystarczy zatwierdzić zmiany w systemie Git. App Hosting może automatycznie wdrażać zmiany za każdym razem, gdy przenosisz je do określonej gałęzi.
|
Wspierane przez Google Cloud |
App Hosting korzysta z Warunków korzystania z usługi Google Cloud i wdraża aplikację w zaufanych usługach Google Cloud. Aplikacje są tworzone za pomocą Cloud Build, udostępniane na Cloud Run i przechowywane w pamięci podręcznej Cloud CDN.
Zintegrowane usługi, takie jak Cloud Secret Manager, zapewniają bezpieczeństwo kluczy interfejsu API.
|
Wdrażanie funkcji opartych na AI na dużą skalę |
Zacznij od przykładów AI, które korzystają z Gemini.
Chroń klucz interfejsu API punktu końcowego interfejsu API za pomocą usługi Cloud Secret Manager i korzystaj z obsługi przesyłania strumieniowego w usłudze App Hosting, aby zachować szybki czas początkowego wczytywania podczas dodawania do aplikacji funkcji generatywnej AI.
|
Integracja z konsolą Firebase |
Monitoruj kompilacje i wdrażanie w Firebasekonsoli, aby zawsze wiedzieć, co się dzieje. Uzyskuj dostęp do dzienników i danych, dodawaj domenę niestandardową i ręcznie uruchamiaj wdrażanie z poziomu konsoli Firebase.
|
Jak to działa?
- Za pomocą Firebase konsoli lub Firebase interfejsu wiersza poleceń autoryzuj i zainstaluj aplikację Firebase GitHub w repozytorium.
- Nadal w Firebase konsoli lub Firebase interfejsie CLI utwórz Firebase App Hosting backend z repozytorium i gałęzią na żywo do ciągłego wdrażania.
App Hosting tworzy domyślne zasady wdrażania dla Twojego backendu, aby wdrażać zmiany na 100% ruchu natychmiast po przesłaniu zmiany do gałęzi docelowej.
- Gdy zatwierdzenie zostanie przesłane do gałęzi na żywo, Google Cloud Developer Connect wyśle zdarzenie do Firebase App Hosting.
- W odpowiedzi na to zdarzenie usługa Firebase App Hosting tworzy nową kompilację backendu połączonego z repozytorium.
- Najpierw Firebase App Hosting tworzy nową kompilację Cloud Build dla Twojego zatwierdzenia. W tym zadaniu pakiety kompilacji Google Cloud określają, którego frameworka używa Twoja aplikacja, aby utworzyć kontener i konfigurację (w tym zmienne środowiskowe, wpisy tajne, minimalną lub maksymalną liczbę instancji, pamięć współbieżną, procesor i konfigurację VPC) odpowiednią dla Twojej aplikacji.
Więcej informacji znajdziesz w App Hostingprocesie tworzenia.
- Po zakończeniu zadania Cloud Build kontener jest przechowywany w repozytorium Artifact Registry przeznaczonym dla Firebase App Hosting.
Firebase App Hosting następnie dodaje nową Cloud Run wersję do Cloud Run usługi, korzystając z Twojego obrazu i konfiguracji.
- Gdy Cloud Run Revision zostanie ukończona i zweryfikowana jako prawidłowa, Firebase App Hosting zmodyfikuje konfigurację ruchu, aby wszystkie nowe żądania kierować do nowej wersji Cloud Run Revision. W tym momencie proces wdrażania jest zakończony.
- Gdy żądanie jest wysyłane do witryny hostowanej w Firebase App Hosting, jest ono obsługiwane przez system równoważenia obciążenia Google Cloud z włączoną usługą Cloud CDN.
Żądania bez pamięci podręcznej są wysyłane do usługi Cloud Run.
Ścieżka implementacji
|
Konfigurowanie Firebase |
Jeśli nie masz jeszcze projektu Firebase, utwórz go i upewnij się, że ma włączony abonament Blaze.
|
|
Skonfiguruj usługę App Hosting |
Za pomocą Firebase konsoli lub Firebase interfejsu CLI utwórz App Hosting backend. Jest to zbiór zarządzanych zasobów aplikacji, w tym połączenie z repozytorium GitHub aplikacji.
|
|
Zarządzanie aplikacją i jej monitorowanie |
Po utworzeniu backendu App Hosting aplikacja jest dostępna w bezpłatnej subdomenie, a szczegóły wdrożenia możesz wyświetlić w konsoli Firebase. Do wyświetlania i przeszukiwania logów możesz używać Google Cloudkonsoli.
|
|
Tworzenie aplikacji |
App Hosting automatycznie rozpoczyna nowe wdrożenie za każdym razem, gdy zatwierdzenie jest przesyłane do gałęzi produkcyjnej.
|
Dalsze kroki
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-31 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."]]