简体   繁体   English

需要在启动时运行应用程序的Node.js docker映像

[英]need for Node.js docker image that run the app when start

I'm using AWS Elastic Beanstalk Multicontainer environment. 我正在使用AWS Elastic Beanstalk Multicontainer环境。

the problem is when using image node:0.12 or node:argon 问题是使用图像节点:0.12或节点:氩气时

the container start then close immediately. 容器开始,然后立即关闭。

node:argon "node" About a minute ago Exited (0) node:argon“ node”大约一分钟前已退出(0)

after investigation we found that we must build our own image with some commands that will start the app when container initialized. 经过调查,我们发现必须使用一些命令来构建自己的映像,这些命令将在容器初始化时启动应用程序。

my question is: 我的问题是:

is there any public node image that do this? 有没有这样做的公共节点映像?

we don't want to create a private repository or build any images. 我们不想创建私有存储库或构建任何图像。

Following is a simple tutorial using argon docker image. 以下是使用argon docker映像的简单教程。

https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ https://nodejs.org/en/docs/guides/nodejs-docker-webapp/

Sample docker file : 样本Docker文件:

FROM node:argon

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY package.json /usr/src/app/
RUN npm install

COPY . /usr/src/app

EXPOSE 8080

CMD [ "npm", "start" ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM