在dockerfile中运行npm install后,node_modules不可用
我尝试为我的节点应用程序创build一个dockerfile。 但运行npm后,我看到
在7.966s添加了160个包
但我没有看到该文件夹中的node_modules,当我启动应用程序,我看到node_moduls丢失=>docker不工作
这是我的dockerfile
FROM keymetrics/pm2:latest # create app directory in container #RUN mkdir -p /app # set /app directory as default working directory WORKDIR /app # only copy package.json initially so that `RUN npm start` layer is recreated only # if there are changes in package.json ADD dist/package.json /app/ ENV MONGO_HOST=mongodb://localhost/chronas-api ENV MONGO_PORT=27017 ENV PORT=80 RUN npm install --production # copy all file from current dir to /app in container COPY dist /app/ #RUN npm install --production RUN ls -al -R # expose port 80 EXPOSE 80 CMD [ "pm2-docker", "start", "index.js" ]
这里是完整的代码https://github.com/daumann/chronas-api/tree/azure
- 是否有可能在Raspberry Pi 2 Model B上安装Docker?
- Docker镜像问题在laradoc
- Docker远程API在创build容器上返回500错误
- ssh使用golang中的交互式shell执行nsenter作为远程命令来debuggingdocker容器
- 使用Mocha + TypeScript + Docker远程debuggingnode.js。 debugging器不反映实际的执行?
- Kubernetes私人registry不起作用
- Docker容器中的巨大文件
- Bluemix Docker容器部署导致“无路由到主机”
- Python烧瓶docker化的Web应用程序api不返回响应错误:BrokenFilesystemWarning