简体   繁体   English

django项目和django应用程序可以具有不同的docker映像吗?

[英]Can django project and django app have different docker image?

If I have 1 Django project and multiple Django apps. 如果我有1个Django项目和多个Django应用程序。 Every Django app has it's own requirements.txt and settings. 每个Django应用程序都有其自己的requirements.txt和设置。 Hence every app has its own docker image. 因此,每个应用程序都有其自己的docker映像。 My doubt is, can I execute code from one Django app to other Django app while both apps have a different container? 我的疑问是,当两个应用程序具有不同的容器时,我可以从一个Django应用程序执行代码到另一个Django应用程序吗?

No, in the context of Django an “app” is a code level abstraction so they all run in one process, which means one image. 不,在Django的上下文中,“应用程序”是代码级抽象,因此它们都在一个进程中运行,即一个图像。 You can, sometimes, break each app into its own project and have then communicate via the network rather than locally, this is commonly called “microservices” and smaller images is indeed one of the benefits. 有时,您可以将每个应用程序分解成自己的项目,然后通过网络而不是本地进行通信,这通常称为“微服务”,较小的映像确实是其中的好处之一。

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

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