I have two projects. An API in Node.js and a web application in PHP.
I'm using jwilder/nginx-proxy and I want to add the API on api.example.com and the application on vault.example.com. On example.com I will have some static HTML pages.
The subdomain for the API works as expected.
Now my question is about the vault subdomain and about the static HTML pages.
To create an image for these projects I have to use Apache or Nginx, which means that the proxy will make a call to another web server to open the applications. Is this a correct way or the best option is to create volumes for these projects and add them inside the proxy with custom conf file?
The best practice for docker containers is to have a single process running in each container:
It is generally recommended that you separate areas of concern by using one service per container.
Source: https://docs.docker.com/config/containers/multi-service_container/
In your scenario, then, it is perfectly fine of you have 3 containers, one for the proxy, one for the node.js code and one for php code.