2
I have an image docker
door 8080
. To execute it I use the following command:
docker run -d -p 8080:8080 -e DB_URL="127.0.0.1:BANCO" -e DB_USERNAME="usr" -e DB_PASSWORD="XXXXX" custom-repo.com.br/teste:1-0-0
I’d like to do the same thing but raise, hypothetically, 5 containers
, each with a different external door pointing to it. For example:
- Port 8080 accesses the
container
1; - Port 8081 accesses the
container
2; - Port 8082 accesses the
container
3; - Port 8083 accesses the
container
4; - Port 8084 accesses the
container
5;
Is there any way to accomplish this without defining one by one?
Needs to be at different doors? Why?
– Woss
@Andersoncarloswoss because I need to make simultaneous calls. I even thought of using a
nginx
but the problem is that the authenticated user on one server cannot request on another (usingJSESSIONID
)– Sorack
Docker Compose has the option
--scale
that allows you to generate multiple instances of your image. Does it not solve your problem?– Woss
@Andersoncarloswoss if generate and I can access without losing this session then I believe it solves yes
– Sorack