D
D
dmitriyprog2020-05-15 17:21:46
Docker
dmitriyprog, 2020-05-15 17:21:46

How to connect to a database that is in docker?

create a service

docker service create --detach --name registry --publish 5441:5440 registry:2

I do next
docker-compose build
docker-compose push

docker stack deploy --compose-file docker-compose.yml mystack


In the docker-compose.yml file, I set the
port for the database

ports:
      - 5440:5440


the database is being built, but I can't connect to it from the outside

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lynnikvadim, 2020-05-16
@lynnikvadim

https://github.com/eko/docker-symfony
here is a good example for symfony

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question