But localhost is not recognized properly when its called from my php-5.6-apache container.
It works from php when I use inspected container’s IP address e.g. http://172.18.0.4:3000. But this is not a good solution because IP address changes when server restarts.
You have to understand that a container is an other “host” at least network-wise. Each container have their own, dedicated “localhost”.
To address one container from an other, you have to use it’s name (as in docker run --name myName). Use docker inspect my-network to list the container and their name.
The easiest way is to use a docker-compose.yaml file, because the container name is the service name. So every container started by compose have a name.
Say you started your converter with this command :
docker run --network my-network --name myconverter zrrrzzt/docker-unoconv-webservice
This commnad works only when called from OS shell:
curl --form file=@/var/xxx/documents/output-odt/test.odt http://localhost:3000/unoconv/pdf > /var/xxx/documents/output-odt/test.pdf