简体   繁体   English

如何从我的应用程序创建Docker映像? 使用MongoDB的是node.js应用程序

[英]How to create Docker-image from my app? It's node.js application that use MongoDB

I have node-applicatiot. 我有节点应用程序。 It's running from terminal and do some operations. 它从终端运行并执行一些操作。 Operations include work with database "MongoDB". 操作包括使用数据库“ MongoDB”。 I need to write dockerfile that create Docker-image from my app. 我需要编写从我的应用程序创建Docker映像的dockerfile。 I read many information, but examples that I found tell about how to create web-app that running on some port. 我阅读了许多信息,但是发现的示例说明了如何创建在某个端口上运行的Web应用程序。 I need just run app from terminal. 我只需要从终端运行应用程序。 What steps I must do? 我必须采取什么步骤?

unfortunately your question is rather vague and I am not really familiar with nodeJs, but as far as my understanding of Docker goes I will try and point you in some direction where you might find the information you are looking for or at least help you to ask a more specific question. 不幸的是,您的问题相当模糊,我对NodeJ并不是很熟悉,但是就我对Docker的理解而言,我将尝试向您指明可能会找到所需信息或至少可以帮助您查询的方向。一个更具体的问题。

From what I can tell what you are looking for is probably a docker image that contains a nodeJs-Server. 据我所知,您所寻找的可能是包含nodeJs-Server的docker映像。 Then you would download that image and create a container from it, you would map the folder containing your node-application as a volume into the container, so the node-Server inside the container can deploy your application. 然后,您将下载该映像并从中创建一个容器,然后将包含节点应用程序的文件夹作为卷映射到容器中,以便容器中的节点服务器可以部署您的应用程序。

At our company we use a JBoss-Application Server inside a Docker-Container to deploy our Java-Applications in pretty much the way I described. 在我们公司,我们使用Docker-Container内部的JBoss-Application Server来以我们几乎所描述的方式部署Java-Applications。 Maybe you should look for some of the words I used on Google (docker volume, docker container, etc.), there are actually lots of documentation and tutorials on docker out there. 也许您应该找一些我在Google上使用过的词(docker volume,docker container等),实际上docker上有很多文档和教程。 A good way to start would probably be here https://docs.docker.com/ ;) 一个好的开始方法可能是在这里https://docs.docker.com/ ;)

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

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