程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了无法在 Google Run 上部署 angular-app大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决无法在 Google Run 上部署 angular-app?

开发过程中遇到无法在 Google Run 上部署 angular-app的问题如何解决?下面主要结合日常开发的经验,给出你关于无法在 Google Run 上部署 angular-app的解决方法建议,希望对你解决无法在 Google Run 上部署 angular-app有所启发或帮助;

用于在 Google Run 上部署应用程序。我已经使用以下内容创建了 Dockerfile:

### STAGE 1: Build ###
FROM node:latest AS build
workdir  /app
copY package.Json package-lock.Json ./
RUN npm install
copY . .
RUN npm run build

### STAGE 2: Run ###
FROM Nginx:1.19.9-alpine
copY --from=build  /app/dist/aistudio /usr/share/Nginx/HTML

在线RUN npm run build上发生的问题。控制台上显示的日志是:

=> ERROR [build 4/6] RUN npm install                                                                                                       352.3s 
------
 > [build 4/6] RUN npm install:
#12 350.8 npm notice
#12 350.8 npm notice New minor version of npm available! 7.7.6 -> 7.8.0
#12 350.8 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.8.0>
#12 350.8 npm notice Run `npm install -g npm@7.8.0` to update!
#12 350.8 npm notice
#12 350.8 npm ERR! code ECONNreset
#12 350.9 npm ERR! network aborted
#12 350.9 npm ERR! network This is a problem related to network connectivity.
#12 350.9 npm ERR! network In most cases you are behind a proxy or have bad network setTings.
#12 350.9 npm ERR! network
#12 350.9 npm ERR! network If you are behind a proxy,please make sure that the
#12 350.9 npm ERR! network 'proxy' config is set properly.  See: 'npm Help config'
#12 351.3
#12 351.3 npm ERR! A complete log of this run can be found in:
#12 351.3 npm ERR!     /root/.npm/_logs/2021-04-04T08_36_13_047Z-deBUG.log
------
executor Failed running [/bin/sh -c npm install]: exit code: 1

任何帮助将不胜感激。这样我就可以成功构建 Angular docker 镜像,然后将其部署在 Google Run 上。谢谢

已编辑

当我有如下所示的简单 Dockerfile 时,docker 镜像构建并成功运行。

FROM Nginx:alpine
copY /dist/aistudio /usr/share/Nginx/HTML

在上述情况下,前两个屏幕已正确加载,但离屏幕3更远,我有例外,例如

无法在 Google Run 上部署 angular-app

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的无法在 Google Run 上部署 angular-app全部内容,希望文章能够帮你解决无法在 Google Run 上部署 angular-app所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。