gcloud-500个内部服务器错误,角度为1 +节点js

时间:2019-05-15 12:11:54

标签: google-cloud-platform gcloud google-cloud-build

我正在获取以下错误日志-

import numpy as np
from cycler import cycler
import matplotlib.pyplot as plt
x = np.random.rand(5,10)
y = np.random.rand(5,10)

color = plt.cm.viridis(np.linspace(0, 1,x.shape[0]))
custom_cycler = (cycler(color=color) *
  cycler(marker=['o', 's']))
fig,ax = plt.subplots()
ax.set_prop_cycle(custom_cycler)
ax.scatter(x,y)
fig,ax2 = plt.subplots()
ax2.plot(x,y)

部署使用Angular(版本1)和node js(版本10)构建的应用程序时

我的应用程序文件夹结构如下,在 client 文件夹中,我有角度js代码,在 server 文件夹中,我有node js-

enter image description here

app.yaml 文件看起来像

2019-05-15 11:51:20 default[20190515t114916]  { [Error: ENOENT: no such file or
directory, stat '/srv/client/dist/client/index.html']
2019-05-15 11:51:20 default[20190515t114916]    errno: -2,
2019-05-15 11:51:20 default[20190515t114916]    code: 'ENOENT',
2019-05-15 11:51:20 default[20190515t114916]    syscall: 'stat',
2019-05-15 11:51:20 default[20190515t114916]    path: '/srv/client/dist/client/i
ndex.html',

和cloudbuild.yaml文件为-

runtime: nodejs10

我是Google Cloud的新手,不确定如何配置yaml文件。有人可以帮我吗?

1 个答案:

答案 0 :(得分:3)

您应该在ng build步骤之后添加install,并附加类似的内容 在app.yaml中

- url: /
  static_files: dist/index.html
  upload: dist/index.html
- url: /
  static_dir: dist

dist文件夹将由ng build创建