it is achievable by using the
networks setting in each docker-compose.yml file. By specifying which network to use, all containers spun up by all docker-compose files can join the same network and send http requests to each other.
Rhonald John Rose
Hi, I would imagine using a container for each component you mentioned and docker-compose them together. A container of Nginx can tackle the load balancing topic, which is beyond a simple app dev scope though.
Generally, the command in each folder’s Dockerfile can be overwritten by definition in a docker-compose file, a Jenkins job, a container command in the cloud, etc.
It depends on how you deploy your app to production.
Brightl I’m mapping the same port number inside Docker to the host machine (like 8000:8000), that’s why I use the same environment variable here. You can of course map different port numbers and thus use different environment variables.