Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照步骤构建镜像,启动报错了,本地start可以起来 #13

Open
Jesyjun opened this issue Dec 24, 2020 · 2 comments
Open

Comments

@Jesyjun
Copy link

Jesyjun commented Dec 24, 2020

[email protected] server /usr/src/app
node app.js

/usr/src/app/node_modules/http-proxy-middleware/dist/config-factory.js:38
throw new Error(errors_1.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING);
^

Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"}
at Object.createConfig (/usr/src/app/node_modules/http-proxy-middleware/dist/config-factory.js:38:15)
at new HttpProxyMiddleware (/usr/src/app/node_modules/http-proxy-middleware/dist/http-proxy-middleware.js:128:40)
at createProxyMiddleware (/usr/src/app/node_modules/http-proxy-middleware/dist/index.js:6:28)
at Object. (/usr/src/app/app.js:14:3)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] server: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-12-24T09_56_36_529Z-debug.log

@judgeeeeee
Copy link

/cc @hewenguang

@hewenguang
Copy link
Contributor

hewenguang commented Dec 24, 2020

你好,很高兴你对我们的产品感兴趣。通过描述,我理解你是本地打得镜像直接 docker run 启动的镜像。

前端的应用,是通过 node 代理的形式去链接后端接口,这里的后端接口是通过跑起来镜像时注入的环境变量。所以会报拿不到环境变量的错误

推荐你使用我们的一键部署代码来启动应用

helm install klever-web $CWD/klever-web/manifests/klever-web
--namespace=kleveross-system
--set service.nodePort=$KLEVER_WEB_PORT
--set model.registry.address=http://$MASTER_IP:$KLEVER_MODEL_REGISTRY_PORT

脚本启动会自动注入环境变量并启动需要依赖的后端服务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants