本文介绍了一个MEAN堆栈码头容器在OS X和DigitalOcean上具有相同配置的最简单的设置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩一个MEAN javascript项目。
(mongoDB + angular + sails.js + node.js)
当我离线很多时候,我想保持我的开发环境,运行在Docker容器中,在OS X笔记本电脑,使用boot2docker。



生产(不是实际的生产,只是我部署到某个地方显示给朋友)是一个数字海洋液滴,运行Ubuntu作为主机和希望是同一个docker容器。



我希望环境不会变化很多,我可以继续使用git push / pull来推动代码更改。 / p>

除了上面描述的内容,我还需要其他任何东西吗?
我需要Vagrant,例如要部署该docker容器或者是一个过度的杀手?
可以对docker指定所有我的需要,那是正确版本的node.js,sails等?
是否有一个现成的容器,我可以重用或修改,而不是从头开始?

解决方案



除上述内容外,我还需要其他任何东西吗?



你说的话听起来很合理。但请记住,您不想使用一个停靠站容器,而是每个服务一个容器。这意味着:一个运行mongo的容器,一个容器运行节点等。这是一个Docker的最佳实践。



我需要Vagrant吗? >

这听起来像你的相当简单的设置不需要Vagrant。您可以使用Dockerfiles构建具有所需安装内容的图像。请参阅和。



可以停靠码指定所有我的需要,这是正确的版本的node.js,sails等?



是的,每个Docker映像都有一个特定版本的服务将在容器内运行。这是使用容器的一个要点。



是否有可以重用或修改的现成容器,而不是从头开始?



是的,在。在编写Dockerfiles时,使用这些图像作为基础,以便在Docker Hub上的图像中提供任何内容。



另外,查看,以了解如何处理开发中的源代码。


I am playing around with a MEAN javascript project.(mongoDB + angular + sails.js + node.js)As I am offline a lot of the time, I'd like to keep my dev environment, running in a docker container, on OS X laptop, using boot2docker.

The 'production' (not actual production, just somewhere I deploy to to show it to friends) is a Digital Ocean droplet running Ubuntu as host and hopefully the same docker container.

I expect that the environment won't change very often and that I can continue using git push/pull to push just the code changes.

Do I need anything else other than what I described above?Do I need Vagrant, for example to deploy that docker container or is that an overkill?Can docker specify all all my needs, that is the right version of node.js, sails etc?Is there a ready made container I can reuse or modify rather than starting from scratch?

解决方案

Answers to your questions:

Do I need anything else other than what I described above?

What you described sounds very reasonable. But keep in mind that you don't want to use one docker container, but rather one container per service. That means: one container running mongo, one container running node, and so on. That is a Docker best practice.

Do I need Vagrant, for example to deploy that docker container or is that an overkill?

It sounds like your rather simple setup does not require Vagrant. You can use Dockerfiles to build images that have everything you need installed. See the Dockerfile Reference and Dockerfile best Practices.

Can docker specify all my needs, that is the right version of node.js, sails etc?

Yes, every Docker image has a certain version of the service that will run inside the container. That's one of the points of using containers.

Is there a ready made container I can reuse or modify rather than starting from scratch?

Yes, there are many ready made containers to be found on the Docker Hub. Use these images as a base when writing your Dockerfiles to install anything additionally to what is supplied within the image on Docker Hub.

Also, check out Volumes to figure out how to handle source code in development.

这篇关于一个MEAN堆栈码头容器在OS X和DigitalOcean上具有相同配置的最简单的设置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 02:04