L
L
letema2018-09-18 17:08:09
Docker
letema, 2018-09-18 17:08:09

How to organize joint work of docker containers?

Tell me please. I have deployed the app in a container via docker compose. The task is to create several more containers with the same settings. When I run in another docker compos container, some apps don't deploy because they say the ports are already in use. I take the same image from the git. How to make the application run in other containers at the same time

Answer the question

In order to leave comments, you need to log in

2 answer(s)
@
@mgyk, 2018-09-19
@letema

You can leave the internal ports the same and change only the binding to the localhost. Localhost Port: Container Port
app1:
ports:
- '3001:3000'
app2:
ports:
- '3002:3000'

R
RidgeA, 2018-09-18
@RidgeA

map to other ports or to another IP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question