Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Firebase App Hosting verwendet Cloud Build, um den Quellcode Ihrer Anwendung in ein containerisiertes Format umzuwandeln, das für die Bereitstellung auf Cloud Run geeignet ist.
Der Build-Prozess umfasst die folgenden wichtigen Phasen:
Aufnehmen: Erfasst den Quellcode und die Konfiguration Ihrer Anwendung.
Build: Installiert Abhängigkeiten und erstellt Ihre Anwendung.
Übergabe: Schließt den Produktionscontainer Cloud Run ab.
Diese drei Schritte entsprechen direkt den Build-Schritten 1, 2 und 3, wie sie in der Google Cloud Console in Cloud Build angezeigt werden:
Aufnahmephase
In dieser Phase wird die Logik vor dem Build verarbeitet. Sie liest, bereinigt und schreibt benutzerdefinierte Umgebungsvariablen. Außerdem werden alle in der Datei apphosting.yaml angegebenen Secrets dereferenziert und angepinnt.
Build-Phase
Dies ist der Kern des Build-Prozesses. Er ist für die Generierung eines ausführbaren Container-Images und einer bundle.yaml-Datei zuständig, in der Ihre Build-Konfiguration definiert ist.
Zum effizienten Verpacken der Anwendung werden Cloud Native Buildpacks verwendet. Weitere Informationen zur Datei bundle.yaml finden Sie auf github.
Buildpacks sind dafür verantwortlich, den Quellcode Ihrer Anwendung in produktionsfertige Container-Images umzuwandeln. Firebase App Hosting verkettet mehrere Buildpacks, um den Build-Prozess abzuschließen:
Runtime Buildpack: Sorgt dafür, dass alle erforderlichen Komponenten zum Ausführen einer einfachen Node.js-Anwendung enthalten sind und Abhängigkeiten installiert werden.
Monorepo-Buildpack: Konfiguriert nachfolgende Buildpacks für die Verarbeitung verschiedener Monorepo-Szenarien.
Framework-Buildpack: Installiert den richtigen Framework-Adapter (z. B. Angular oder Next.js) und bereitet nachfolgende Buildpacks vor.
Framework-Adapter sind dafür zuständig, den Befehl für den Produktions-Build auszuführen und alle relevanten frameworkspezifischen Konfigurationswerte in ein Standardformat zu übertragen, das von App Hosting gelesen werden kann.
Package Manager Buildpack: Führt die Installation von Abhängigkeiten aus und erstellt die App mit npm, yarn oder pnpm.
Output Bundle Buildpack: Definiert den Ausführungsbefehl und bereitet das Ausgabebündel für die Ausführung vor.
Übergabephase
In dieser letzten Phase werden alle Informationen, die aus dem Anwendungsquellcode extrahiert wurden, sowie das Build-Container-Image verpackt und an das App Hosting-Back-End gesendet. Das App Hosting-Backend verwendet diese Informationen dann, um Cloud Run mit den richtigen Konfigurationen einzurichten.
Weitere Informationen
Der gesamte App Hosting-Build-Prozess ist Open Source.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-31 (UTC)."],[],[],null,["\u003cbr /\u003e\n\nFirebase App Hosting utilizes Cloud Build to transform your\napplication source code into a containerized format suitable for deployment on\nCloud Run.\n\nThe build process operates through the following key stages:\n\n1. **Ingest**: Gathers your application source code and configuration.\n\n2. **Build**: Installs dependencies and builds your application.\n\n3. **Handoff** : Finalizes the production Cloud Run container.\n\nThese three steps correspond directly to build steps 1, 2 and 3 as displayed in\nCloud Build in the Google Cloud Console:\n\nIngest stage\n\nThis stage is responsible for handling pre-build logic. It reads, sanitizes, and\nwrites user-defined environment variables. It also dereferences and pins any\nsecrets specified in the `apphosting.yaml` file.\n\nBuild stage\n\nThis is the core of the build process, responsible for generating a runnable\ncontainer image and a `bundle.yaml` file defining your build configuration.\nIt utilizes [Cloud Native Buildpacks](https://cloud.google.com/docs/buildpacks/overview)\nto package the\napplication efficiently. More information on the `bundle.yaml`file can be found\non [github](https://github.com/FirebaseExtended/firebase-framework-tools).\n\nBuildpacks are responsible for transforming your application source code into\nproduction ready container images. Firebase App Hosting chains together\nseveral buildpacks to complete the build process:\n\n1. **Runtime Buildpack**: Ensures all necessary components for running a basic Node.js application are included and dependencies are installed.\n2. **Monorepo Buildpack**: Configures subsequent buildpacks to handle different monorepo scenarios.\n3. **Framework Buildpack**: Installs the correct framework adapter (like\n Angular or Next.js) and prepares subsequent buildpacks.\n\n Framework adapters are in charge of running the productionized build\n command and mapping any relevant framework-specific config values to a\n standard format readable by App Hosting.\n4. **Package Manager Buildpack**: Executes the installation of dependencies and\n builds the app using npm, yarn, or pnpm.\n\n5. **Output Bundle Buildpack**: Defines the run command and prepares the output\n bundle for execution.\n\nHandoff stage\n\nThis final stage packages all the information extracted from the application\nsource code plus the build container image and sends it to the App Hosting\nbackend. The App Hosting backend then uses this information to set up\nCloud Run with the proper configurations.\n\nLearn more\n\nThe entire App Hosting build process is open source.\n\n- The buildpack code is in [the Google Cloud buildpacks repo](https://github.com/GoogleCloudPlatform/buildpacks)\n- Code for framework adapters is in the [firebase-framework-tools repo](https://github.com/FirebaseExtended/firebase-framework-tools)\n- Learn more about [Cloud Native buildpacks](https://cloud.google.com/docs/buildpacks/overview) and [Cloud Build](https://cloud.google.com/build/docs/overview)"]]