8

Imagine in your stack you have RESTful services which also provide some rudimentary frontends, mostly for admin/other tech user use.

Do you include the UI inside the container or are these two containers? Why?

Ta Mu
  • 6,772
  • 5
  • 39
  • 82

2 Answers2

9

Are they separate projects (from a logical or technical perspective)? Would one ever need to be updated/recreated independently of the other one? Would they need to scale independently of each other? I think if any of those answers is a yes, then they should be separated. If not, you should be fine bundling them together. Bundling them together will reduce discrepancy or compatibility issues between the two containers.

Preston Martin
  • 3,278
  • 4
  • 17
  • 39
2

We always use different container for each service (Like Frontend ,Backend and Database). Because a container can run only a single service inside it at a time by using docker-compose.yml file. But we can define multiple services inside one docker-compose.yml file but one for each container.

user12220
  • 21
  • 1