I started studying docker containers and want to be told what I am wrong about. There is a web application that includes a database, a parser of other sites and routing with distribution of API to users. The question is whether it will be right to make three containers in this way:
- There will be a database at port 27017,
- One Express application on port 3000 that connects to the database on port 27017, in which there will be only one route for the parsing page
http://localhost:3000/parseis hosted by Some kind of admin panel. - Another Express application on port 5000, where there will be a routing for users and and delivery of data to users via an API that will be taken from the database on port 27017
And collect the whole thing through docker-compose.
Perhaps I misunderstood the concept, because there is not so much information, basically all the guides end up connecting the application and database in different containers, but there are simply no more complicated examples. But as far as I understand, a separate Node.js application is hosted in each container, but they all communicate on the same domain name at different ports. Correct or give some advice please.