更新:使用
solution
由@FrederikNS提供。
我也遇到了同样的问题。当文件夹
/worker
被装载到容器中——它的所有内容都将被同步(因此,如果本地没有node_modules文件夹,它将消失。)
由于基于操作系统的npm软件包不兼容,我不能只在本地安装模块,然后启动容器,所以。。
我的解决方案是用一个
src
node_modules
使用
this index.js file
.所以
index.js
文件现在是我申请的起点。
当我运行容器时,我安装了
/app/src
文件夹到我的本地
src
文件夹
容器文件夹看起来像这样:
/app
/node_modules
/src
/node_modules -> ../node_modules
/app.js
/index.js
它是
丑陋的
,但它是有效的。。