使用docker compose部署失败
wxhuang opened this issue · 5 comments
wxhuang commented
$ docker-compose up
...
web_1 | /var/app/cnpmjs.org/config/config.js:131
web_1 | nfs: require('fs-cnpm')({
web_1 | ^
web_1 |
web_1 | TypeError: Class constructor LocalDiskClient cannot be invoked without 'new'
web_1 | at Object.<anonymous> (/var/app/cnpmjs.org/config/config.js:131:26)
web_1 | at Module._compile (internal/modules/cjs/loader.js:999:30)
web_1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
web_1 | at Module.load (internal/modules/cjs/loader.js:863:32)
web_1 | at Function.Module._load (internal/modules/cjs/loader.js:708:14)
web_1 | at Module.require (internal/modules/cjs/loader.js:887:19)
web_1 | at require (internal/modules/cjs/helpers.js:74:18)
web_1 | at Object.<anonymous> (/var/app/cnpmjs.org/config/index.js:355:10)
web_1 | at Module._compile (internal/modules/cjs/loader.js:999:30)
web_1 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
cnpmjsorg_web_1 exited with code 1
这个问题我提交PR了,麻烦处理一下。
xzt427 commented
请问解决了吗?我也遇到了这个问题
wxhuang commented
请问解决了吗?我也遇到了这个问题
PR已经提了,等不及的话照着抄过去部署就好了。
话说这个项目的PR好像没人review?是我提交方式有问题还是怎么的?
xx-zhang commented
配置
version: '2'
services:
web:
image: registry.cn-hangzhou.aliyuncs.com/rapid7/cnpmjs
container_name: cnpmjs
depends_on:
- mysql-db
volumes:
- ./docs/dockerize/config.js:/var/app/cnpmjs.org/config/config.js
- /srv/docker/cnpm-files:/var/data/cnpm_data
ports:
- "7001:7001"
- "7002:7002"
在 ./docs/dockerize/config.js 使用index.js替换,解决了问题。
spadeACE7 commented
将 require('fs-cnpm') 引入 然后New 使用