Should I use separate Docker containers for my web app?

后端 未结 5 733
北恋
北恋 2021-02-05 02:18

Do I need use separate Docker container for my complex web application or I can put all required services in one container? Could anyone explain me why I should divide my app t

5条回答
  •  悲&欢浪女
    2021-02-05 02:46

    It is probably better to have your webapp in a single container and your supporting services like databases etc. in a separate containers. By doing this if you need to do rolling updates or restarts you can keep your database online while your application nodes are doing individual restarts so you wont experience downtime. If you have caching with something like Redis etc this is also useful for the same reason. It will also allow you to more easily add nodes to scale in a loosely coupled fashion. It will also allow you to manage the containers in a manner more suitable to a specific purpose. For the type of application you are describing I see very few arguments for running all services on a single container.

提交回复
热议问题