Sign in
Log inSign up
Yash Dalal

173 reads

3 comments

Abhay Rajpurohit
Abhay Rajpurohit
Jun 15, 2024

Can we have multiple projects in a single container,because you have mentioned 2 ports one is to redirect and other to find the code. For example one project is in 8000:8000 Other in 8000:8001

·
·2 replies
Yash Dalal
Yash Dalal
Author
·Jun 15, 2024

Yes, you can have multiple projects in one container but you need to publish its port also. let's say you also have react code in the container then you need to modify the dockerfile according to it and while creating the container you need to publish it port like 3000:3000. but you can't do 8000:8000 and 8000:8001 as it isn't able to distinguish which port to forward the request.

·
Abhay Rajpurohit
Abhay Rajpurohit
Jun 15, 2024

Ohk, so according to this we can have a frontend, backend and database inside on a docker. But we can have only one port like 3000:3000 and we can only access that ,so in case if it is associated with react it will redirect to react and we cannot access backend code it will only go through frontend.

·