I have a web application running inside a php:7.1.8-apache
docker container. The application has port 80
inside the container and port 8080
outside of it.
One part of the application sends requests to itself, but uses the outside hostname/port (for example to http://outsidehostname.local:8080
).
This doesn't work because the port and the hostname does not exist inside the container.
I already tried the --hostname
flag, but this doesn't solve the problem with the different port inside and outside of my container. So I am looking for a different solution.
The hostname (outsidehostname.local
) comes from the host os (in my case macos). I am using dnsmasq
to resolve all *.local
hostnames to 127.0.0.1
.
Is there any way to configure docker so that this request works without changing the behavior of the application?