0
I’m using Docker to develop my web applications, but I realized I need to run several projects at the same time on my machine. Since these projects basically need the same containers, which are apache and mysql, whenever I start some project on my machine, I need to keep changing the host port. Is there any way I can automatically set a port to the container I want to create? For example, if port 80 is already being occupied by apache from another application, it automatically allocates another port for the application to be started.
I would also like to know if there is a way to configure the url of the application. for example, I currently access a project of mine through the link: localhost:3000. There is how I type in my browser meuprojeto.com.br and it direct to localhost:3000?
Show @Luiz, this part worked on my Docker-Compose, but to be able to use dynamic port allocation, it would be necessary to configure a url for the container, so Docker-Compose would find out which port is used and when I type in my browser, for example, projectTeste.com, it would access the container ip and port.
– Bernardo Kowacic