alarm-dog icon indicating copy to clipboard operation
alarm-dog copied to clipboard

部署完打不开

Open zhenglin305 opened this issue 3 years ago • 3 comments

部署完打开htttp://ip:8081 提示404 Not Found怎么搞? 我看nginx配置/admin转到 /opt/www/dist,然而opt/www/下根本没有dist目录

zhenglin305 avatar Nov 10 '20 08:11 zhenglin305

我也遇到了 应该是打包的时候出问题了 你可以看看容器的日志

vbigbang avatar Nov 26 '20 12:11 vbigbang

同样遇到,执行容器日志看到:

% docker logs -f  alarm-dog_fe_1
yarn config v1.22.4
success Set "registry" to "https://registry.npm.taobao.org".
Done in 0.08s.
yarn run v1.22.4
$ vue-cli-service build
/bin/sh: vue-cli-service: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn-error.log

Arguments: 
  /usr/local/bin/node /opt/yarn-v1.22.4/bin/yarn.js install

PATH: 
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Yarn version: 
  1.22.4

Node version: 
  12.18.4

Platform: 
  linux x64

Trace: 
  Error: ENOENT: no such file or directory, copyfile '/usr/local/share/.cache/yarn/v6/npm-@types-node-13.7.7-1628e6461ba8cc9b53196dfeaeec7b07fa6eea99-integrity/node_modules/@types/node/ts3.2/globals.d.ts' -> '/opt/www/node_modules/@types/node/ts3.2/globals.d.ts'

JoeXiong avatar Feb 05 '21 07:02 JoeXiong

进入容器:docker exec -it alarm-dog_fe_1 /bin/bash 执行:yarn install 再执行: yarn build

....
  dist/static/css/chunk-a9c627b4.d558187    0.13 KiB         0.11 KiB
  c.css
  dist/static/css/chunk-f83072aa.d558187    0.13 KiB         0.11 KiB
  c.css

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
                                  
Done in 101.96s.

成功构建

怀疑是否是docker执行 yarn install 下载依赖包不完整导致构建失败

JoeXiong avatar Feb 05 '21 09:02 JoeXiong