B
B
Bogdan2021-01-04 13:50:41
Docker
Bogdan, 2021-01-04 13:50:41

docker-compose connect locally?

Hello, but do not tell me? There is a docker-compose in which the database is spinning, how can I connect to it locally? if you take ip
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}
then it doesn't change after reboot.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zohan1993, 2021-01-04
@zohan1993

https://docs.docker.com/config/containers/containe...
example for mysql

ports:
      - "127.0.0.1:3306:3306"

and connect to 127.0.0.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question