我想为docker容器创建下面提到的场景的docker-compose配置: -
1)我在Azure框中安装了Ubuntu14.04。我在主机操作系统中安装了mongodbversion 3.2,即Ubuntu 14.04 2)现在,我将创建总共6个容器(nginx,web-app,redis,mongodb,worker,数据容器,使用来自mongodb容器的图像)解释为: -
i) Data-container that mounts the directory where monogdb3.2 installed in host Ubuntu writes data (what is the absolute full path for directory where mongodb stores or writes data ?)
ii) A mongodb-container that serves as db-backend for web-app container. This mongodb-container should use volume mounted in data-container.
iii) mongodb-container should write data in directory on host Ubuntu ie the directory where mongodb3.2 installed in host Ubuntu writes data or directory mounted in data-container.
iv) I will stop mongod daemon installed in host ubuntu from running automatically and free the port for db-container to use.
v) If i delete and remove containers, I will start the mongod daemon in host Ubuntu and can easily access db and data inside directory.
所以,基本上我想知道,
上述步骤是否足够可行,以便轻松保留数据以供备份或将来使用,如果不是正确的方法?
另外,如何创建不运行任何应用程序的数据容器,并且仅用作数据持久性的卷或目录提供程序?
另外,我想获得有关docker的指南或教程,并且它以一种简单易懂的方式工作,可以以正确和易懂的方式教授docker概念?
希望我的问题解释有意义。谢谢。快乐的编码。