Search code examples
dockerexpressgoogle-app-engineweb-development-serverheadless-cms

How many docker containers do i need, and how do i sperate code between them?


I'm in the process of designing a web-service hosted with Google App Engine comprised of three parts, a client website (or more), a simple CMS I designed to edit and view the content of that website, and lastly a server component to communicate between these two services and the database. I am new to docker and currently doing research to figure out how exactly to set up my containers along with the structure of my project.

I would like each of these to be a separate service, and therefor put them in different containers. From my research it seems perfectly possible to put them in separate containers and still have them communicate, but is this the optimal solution? Also given that in the future I might want to scale up so that my backed can supply multiple different frontends all managed from the same CMS.

tldr:
How should I best structure my web-service with docker, as well as assuming my back-end supplies more than one front end managed from a CMS.

Any suggestion for tools, or design patterns that make my life easier are welcome!


Solution

  • Personally, I don't like to think of designing whatever in terms of containers. Containers should be good for deployment process, for their main goal.

    If you keep your logic in separate components/services you'll be able to combine them within containers in many different ways.

    Once you have criteria what suits your product requirements (performance, price, security etc) you'll configure your docker images in the way you prefer.

    So my advise is focus on design of your application first. Start from the number of solutions you have, provide a dockerfile for each one and then see what you will have to change.