fanchangyong / deershare

小鹿快传,一款在线P2P文件传输工具,使用WebSocket + WebRTC技术
https://deershare.com
MIT License
1.14k stars 188 forks source link

docker部署的,无法访问. #8

Closed Jonnyan404 closed 4 years ago

Jonnyan404 commented 4 years ago

版本信息:

node: v12.18.1 yarn: 1.22.4 pm2: 4.4.0 端口暴露: 3000

错误:

Error occured while trying to proxy to: 10.10.10.10:3000/


Jonnyan404 commented 4 years ago

0|server | 2020-07-25T05:50:22.781Z unable to find Chrome install. Please specify with chromeLocation 1|client | [HPM] Error occurred while trying to proxy request / from 127.0.0.1:3000 to http://127.0.0.1:3001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) 在哪里指定 chrome 路径呢?

fanchangyong commented 4 years ago

执行的docker命令是啥呢

Jonnyan404 commented 4 years ago

执行的docker命令是啥呢

docker run -d --name share -p 3000-3001:3000-3001 share

跟命令没啥关系吧

Jonnyan404 commented 4 years ago

我翻了一圈,改过webpack的target参数,都是2楼那些错误....

Jonnyan404 commented 4 years ago

server.log


> server@0.0.0 start /app/server
> gulp

[06:05:17] Requiring external module @babel/register
[06:05:18] Using gulpfile /app/server/gulpfile.babel.js
[06:05:18] Starting 'default'...
[06:05:18] Starting 'envDev'...
[06:05:18] Finished 'envDev' after 1.19 ms
[06:05:18] Starting 'server'...
[06:05:18] Finished 'server' after 33 ms
[06:05:18] Finished 'default' after 38 ms
[06:05:18] [nodemon] 1.19.4
[06:05:18] [nodemon] to restart at any time, enter `rs`
[06:05:18] [nodemon] watching dir(s): **/*
[06:05:18] [nodemon] watching extensions: js,json
[06:05:18] [nodemon] starting `node src/index.js`
Listening on port 3001
Starting prerender
2020-07-25T06:05:20.509Z Starting Prerender
2020-07-25T06:05:20.510Z Starting Chrome
2020-07-25T06:05:20.511Z unable to find Chrome install. Please specify with chromeLocation
2020-07-25T06:05:20.512Z Prerender server accepting requests on port 3999
2020-07-25T06:05:20.512Z undefined
2020-07-25T06:05:20.514Z Failed to start and/or connect to Chrome. Please make sure Chrome is running
2020-07-25T06:05:20.514Z Stopping Chrome
[06:05:20] [nodemon] clean exit - waiting for changes before restart

client.log

> client@1.0.0 start /app/client
> node scripts/start.js

ℹ 「wds」: Project is running at http://localhost:3000/
ℹ 「wds」: webpack output is served from /static/js
ℹ 「wds」: Content not from webpack is served from /app/client
Starting the development server...

ℹ 「wdm」: Hash: 3b23155f22fe39408921
Version: webpack 4.41.5
Time: 6530ms
Built at: 07/25/2020 6:05:25 AM
          Asset       Size  Chunks             Chunk Names
index.bundle.js   6.42 MiB   index  [emitted]  index
     index.html  226 bytes          [emitted]
Entrypoint index = index.bundle.js
[0] multi (webpack)-dev-server/client?http://localhost ./src/index.js 40 bytes {index} [built]
[./node_modules/normalize.css/normalize.css] 589 bytes {index} [built]
[./node_modules/react-dom/index.js] 1.33 KiB {index} [built]
[./node_modules/react-ga/dist/esm/index.js] 1.84 KiB {index} [built]
[./node_modules/react-redux/es/index.js] 776 bytes {index} [built]
[./node_modules/react-router-dom/esm/react-router-dom.js] 9.76 KiB {index} [built]
[./node_modules/react/index.js] 190 bytes {index} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost] (webpack)-dev-server/client?http://localhost 4.29 KiB {index} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {index} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {index} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {index} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {index} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {index} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {index} [built]
[./src/index.js] 1.09 KiB {index} [built]
    + 269 hidden modules
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks  Chunk Names
    index.html  536 KiB       0
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html] 426 bytes {0} [built]
    [./node_modules/lodash/lodash.js] 530 KiB {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
ℹ 「wdm」: Compiled successfully.
Jonnyan404 commented 4 years ago
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/pm2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Jonnyan404 commented 4 years ago

我发现了,这是你代码问题,我在本地部署也是一样的错误......
不知道你这个master 和 v2 分支是否一样?

Jonnyan404 commented 4 years ago

两个分支都试了,都是同样的错误. [HPM] Error occurred while trying to proxy request / from 172.23.11.6:3000 to http://localhost:3001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

Jonnyan404 commented 4 years ago

两个分支都试了,都是同样的错误.

[HPM] Error occurred while trying to proxy request / from 172.23.11.6:3000 to http://localhost:3001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

fanchangyong commented 4 years ago

是不是你的server启动失败了? 可以看一下3001的端口是否存在

Jonnyan404 commented 4 years ago

是不是你的server启动失败了? 可以看一下3001的端口是否存在

确实是哎,这个要怎么解决? 我重启了,3001还是监听不起来.

Jonnyan404 commented 4 years ago

是不是你的server启动失败了? 可以看一下3001的端口是否存在

进程是存在的.

fanchangyong commented 4 years ago

看起来是puppeteer安装失败了,可以搜一下puppeteer china mirror,很有可能是墙的问题

Jonnyan404 commented 4 years ago

puppeteer

我的机器在aws上,不存在墙的问题,但是好像没看到你哪里有写要安装 puppeteer

Jonnyan404 commented 4 years ago

看起来是puppeteer安装失败了,可以搜一下puppeteer china mirror,很有可能是墙的问题

我刚 npm i puppeteer 还是没用,一样没法连接chrome,看来需要改代码来调用本地目录的chrome了,请问要改哪里呢?

fanchangyong commented 4 years ago

puppeteer

我的机器在aws上,不存在墙的问题,但是好像没看到你哪里有写要安装 puppeteer

Puppeteer是prerender的一个依赖项。

fanchangyong commented 4 years ago

看起来是puppeteer安装失败了,可以搜一下puppeteer china mirror,很有可能是墙的问题

我刚 npm i puppeteer 还是没用,一样没法连接chrome,看来需要改代码来调用本地目录的chrome了,请问要改哪里呢?

这个具体请看一下puppeteer相关的文档了

Jonnyan404 commented 4 years ago

puppeteer

我的机器在aws上,不存在墙的问题,但是好像没看到你哪里有写要安装 puppeteer

Puppeteer是prerender的一个依赖项。

有特定版本限制吗?

Jonnyan404 commented 4 years ago

哎,算了,水平有限,解决不了.打扰了~~~

Jonnyan404 commented 4 years ago
Jonnyan404 commented 4 years ago

哇,我真的太难了,终于搞定了~~~ amd64/arm64 双平台支持

运行命令: docker run -d --name share -p 3000:3000 jonnyan404/deershare