จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Firebase App Hosting
plat_web
Firebase App Hosting ช่วยให้การพัฒนาและการติดตั้งใช้งานเว็บแอปแบบไดนามิกเป็นไปอย่างราบรื่น
โดยมีการผสานรวม GitHub และผสานรวมกับผลิตภัณฑ์อื่นๆ ของ Firebase เช่น Authentication, Cloud Firestore และ Firebase AI Logic
App Hosting มีการรองรับ Next.js และ Angular ในตัวที่กำหนดค่าไว้ล่วงหน้า
รวมถึงการรองรับที่กว้างขึ้นสำหรับเฟรมเวิร์กเว็บยอดนิยมต่างๆ
เริ่มต้นใช้งาน
ความสามารถหลัก
การผสานรวม GitHub |
คุณเพียงแค่ใช้คำสั่ง git commit ก็สามารถเปิดตัวแอปเวอร์ชันใหม่ได้
App Hosting สามารถทําการติดตั้งใช้งานโดยอัตโนมัติทุกครั้งที่คุณ
พุชไปยังกิ่งก้านที่เฉพาะเจาะจง
|
ได้รับการสนับสนุนจาก Google Cloud |
App Hosting ใช้ข้อกำหนดในการให้บริการของ Google Cloud และนำแอปของคุณไปใช้งาน
ในผลิตภัณฑ์ Google Cloud ที่คุณเชื่อถือ แอปสร้างขึ้นด้วย Cloud Build
ให้บริการใน Cloud Run และแคชใน Cloud CDN
บริการที่ผสานรวม เช่น Cloud Secret Manager จะช่วยรักษาคีย์ API ของคุณให้ปลอดภัย
|
เปิดตัวฟีเจอร์ที่ทำงานด้วยระบบ AI ในวงกว้าง |
เริ่มต้นด้วยตัวอย่าง AI ที่ใช้ Gemini
ปกป้องคีย์ API ของปลายทาง API ด้วย Cloud Secret Manager และใช้ประโยชน์จาก
การรองรับการสตรีมของ App Hosting เพื่อรักษาเวลาในการโหลดเริ่มต้นที่รวดเร็วขณะที่คุณ
เพิ่มฟีเจอร์ Generative AI ลงในแอป
|
การผสานรวมกับคอนโซล Firebase |
ตรวจสอบบิลด์และการเปิดตัวในFirebaseคอนโซลเพื่อให้คุณ
ทราบความคืบหน้าอยู่เสมอ เข้าถึงบันทึกและเมตริก เพิ่มโดเมนที่กำหนดเอง
และทริกเกอร์การเปิดตัวด้วยตนเองจากFirebaseคอนโซล
|
วิธีการทำงาน
- ใช้Firebaseคอนโซลหรือ FirebaseCLI เพื่อให้สิทธิ์และติดตั้ง
แอป Firebase GitHub ในที่เก็บ
- ยังอยู่ในFirebaseคอนโซลหรือ Firebase CLI ให้สร้างFirebase App Hostingแบ็กเอนด์ที่มีที่เก็บและกิ่งแบบสดสำหรับการ
ติดตั้งใช้งานอย่างต่อเนื่อง
App Hosting สร้างนโยบายการเปิดตัวเริ่มต้นสำหรับแบ็กเอนด์เพื่อเปิดตัว
การเข้าชม 100% ทันทีเมื่อมีการพุชการเปลี่ยนแปลงไปยังสาขาเป้าหมาย
- เมื่อมีการพุชการคอมมิตไปยังกิ่งก้านที่ใช้งานจริง Google Cloud Developer Connect
จะส่งเหตุการณ์ไปยัง Firebase App Hosting
- เมื่อตอบสนองต่อเหตุการณ์นี้ Firebase App Hosting จะสร้างบิลด์ใหม่สำหรับ
แบ็กเอนด์ที่เชื่อมต่อกับที่เก็บ
- ก่อนอื่น Firebase App Hosting จะสร้างCloud Buildบิลด์ใหม่สำหรับ
คอมมิตของคุณ ในงานนี้
Buildpack ของ Google Cloud
จะพิจารณาว่าแอปพลิเคชันของคุณใช้เฟรมเวิร์กใด
เพื่อสร้างคอนเทนเนอร์และการกำหนดค่า (รวมถึง
ตัวแปรสภาพแวดล้อม, ข้อมูลลับ, อินสแตนซ์ขั้นต่ำหรือสูงสุด, หน่วยความจำพร้อมกัน
, CPU และการกำหนดค่า VPC) ที่เหมาะกับแอปพลิเคชันของคุณ
ดูข้อมูลเพิ่มเติมได้ที่App Hostingกระบวนการสร้าง
- เมื่อCloud Buildงานเสร็จสมบูรณ์แล้ว ระบบจะจัดเก็บคอนเทนเนอร์ของคุณไว้ในArtifact Registryที่เก็บที่สร้างขึ้นสำหรับ Firebase App Hosting โดยเฉพาะ
Firebase App Hosting จากนั้นจะเพิ่มCloud Runรีวิชันใหม่ลงในCloud Runบริการโดยใช้รูปภาพและการกำหนดค่าของคุณ
- เมื่อการแก้ไข Cloud Run เสร็จสมบูรณ์และได้รับการยืนยันว่าทำงานได้ดี
Firebase App Hosting จะแก้ไขการกำหนดค่าการเข้าชมเพื่อเปลี่ยนเส้นทางคำขอใหม่ทั้งหมด
ไปยังการแก้ไข Cloud Run ใหม่ ตอนนี้การเปิดตัว
เสร็จสมบูรณ์แล้ว
- เมื่อมีการส่งคำขอไปยังเว็บไซต์ที่โฮสต์ใน Firebase App Hosting ตัวจัดสรรภาระงานของ Google Cloud จะให้บริการคำขอโดยเปิดใช้ Cloud CDN
ระบบจะส่งคำขอที่ไม่ได้แคชไปยังCloud Runบริการของคุณ
เส้นทางการติดตั้งใช้งาน
|
ตั้งค่า Firebase |
หากยังไม่มี ให้สร้างโปรเจ็กต์ Firebase และตรวจสอบว่าได้เปิดใช้
แพ็กเกจราคา Blaze แล้ว
|
|
ตั้งค่า App Hosting |
สร้างApp Hostingแบ็กเอนด์ด้วยFirebaseคอนโซลหรือ Firebase CLI ซึ่งเป็นคอลเล็กชันของทรัพยากรที่มีการจัดการสำหรับ
แอปของคุณ รวมถึงการเชื่อมต่อกับที่เก็บ GitHub สำหรับแอปของคุณ
|
|
จัดการและตรวจสอบแอป |
เมื่อสร้างแบ็กเอนด์ App Hosting เสร็จแล้ว แอปจะ
พร้อมใช้งานในโดเมนย่อยฟรี และคุณจะดูรายละเอียดเกี่ยวกับการ
เปิดตัวได้ในคอนโซล Firebase คุณสามารถใช้Google Cloudคอนโซล
เพื่อดูและค้นหาในบันทึกได้
|
|
พัฒนาแอป |
App Hosting จะเริ่มการเปิดตัวใหม่โดยอัตโนมัติทุกครั้งที่มีการพุชคอมมิต
ไปยังกิ่งที่ใช้งานจริง
|
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 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."]]