M
M
millok2019-12-12 19:51:29
Web development
millok, 2019-12-12 19:51:29

How to use normal site addresses instead of localhost in docker?

If I have a container with Apache and php running for web development, and I want to see the results of my work in the browser at google.com, but they are only available on localhost, how can I fix this quickly and correctly?
The only option that I thought would work, but was wrong, was to find out the ip of the container through docker inspect, and then manually dock it and the required domain in the hosts file, but this is a bit dreary, and docker is a very convenient thing and it seems to me that there are simpler options but couldn't find anything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-12-12
@millok

Your server (in this case Apache) inside the container should listen on your external IP address on the correct port. And this external ip must be registered in the dns records of the domain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question