I hope you are doing well.
My site consists of three parts.
- I developed the front-end part with Angular
- the back-end section with Nest JS
- the database is MongoDB.
My goal is to have each of these sections run in a separate Docker container.
Suppose the names of the containers are as follows.
- angularContainer
- nestContainer
- databaseContainer
The connection between the nestContainer and databaseContainer is established with the network. And to prevent ephemeral, volume has been used in the databaseContainer.
My questions and challenges:
- I want to use nginx. Should I install nginx in each of angularContainer and nestContainer? Or just install an nginx on the host?
- What is the best practice for running Angular inside the container? I want to use the dist folder.
- What is the best practice for running nestjs inside the container? I want to use the dist folder.
- I want to use Reverse Proxy for containers. so that the angularContainer is called with the mysite.com and the nestContainer is called with the api.mysite.com. How can I achieve this?
If you show some simple examples to guide me. I will be very grateful.