停止将Nodejs应用程序 - 复制从本地到WorkDir复制文件的错误
我正在尝试扩展使用Firebase Cloud函数的Nodejs应用程序。
这就是我的项目目录的外观 -
在不使用Docker的情况下运行时,我按照以下步骤启动服务器 -
cd functions
yarn serve
- 此脚本存在于functions/poffage.json
现在,我想对此应用程序进行dockerize,我创建的dockerfile看起来像这样 -
FROM node:14-alpine
WORKDIR /api
COPY package*.json ./
RUN npm install
COPY . ./api
CMD ["npm", "run", "serve"]
当我使用它构建图像并运行容器时,执行失败会失败(我认为这是因为容器中缺少文件)
用于构建图像的命令 - docker build -t< my-image-name> ../功能
当我查看容器文件系统时,我看不到我在计算机上拥有的确切文件结构。
Dockerfile所需的所有更改是什么?
I am trying to Dockerize my Nodejs application which uses Firebase cloud functions.
This is what my project directory looks like -
When running without using Docker, I follow the following steps to start the server -
cd functions
yarn serve
- this script is present infunctions/package.json
Now I want to Dockerize this application, the Dockerfile which I created looks like this -
FROM node:14-alpine
WORKDIR /api
COPY package*.json ./
RUN npm install
COPY . ./api
CMD ["npm", "run", "serve"]
When I build an image using this and run the container, execution fails (I think it's because of missing files in the container)
Command used to build image -docker build -t <my-image-name> ../functions
When I look into container file system I do not see the exact file structure which I have on my machine.
What are all the changes needed in Dockerfile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论