Nice article! For me, I try to assign a static IPV4 to the container, so each time I can connect using my DB GUI Dbeaver without changing the IP address each time I start the container
If inside the container, yes localhost is fine. But I don't know how else from host we can connect to container without using IP/port. And since docker will assign random IP address, my preference would always be to tell docker to assign specific IP.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article! For me, I try to assign a static IPV4 to the container, so each time I can connect using my DB GUI
Dbeaver
without changing the IP address each time I start the containerThat sounds like a good idea. But can't you connect to the database with
localhost
?The alternative to hardcoding the values for Postgres would be to use environment variables, of course.
If inside the container, yes localhost is fine. But I don't know how else from host we can connect to container without using IP/port. And since docker will assign random IP address, my preference would always be to tell docker to assign specific IP.