我有一个应用程序,它的前端部分是用 React 编写的。这个应用程序以多阶段图像构建的方式构建工件(具体来说是一个bundle.js文件):
from node:8 as builder
# build the bundle.js file
...
from nginx
# serve the bundle.js file
...
这样我就有非常小的图像,其中只有bundle.js文件。
为了提供 bundle.js 文件,我想将此工件推送到 Google Cloud Storage 存储桶并在其上启用 CDN。这样做的最佳做法是什么?
应用程序的后端将使用 Skaffold、Container Builder 和 Kubernetes Engine。因此,如果可能的话,最好将 Container Builder 用于前端。