Docker Networking and Transform Servers

Modified on: Thu, 16 May, 2019 at 12:58 PM

Ideally the iTDS server and transform server should have their own IP addresses. The iTDS can then proxy traffic to the transform server using the IP address of the transform server on your local network.

In some cases, you may have the transform server running on the same host machine as the iTDS, and would like to proxy transforms to "localhost".

Switch to Host Networking

It is possible to switch the servers to run using "network_mode: host" so that services running in the Docker containers can also access services running on the host machine. Switching to host networking, removes the isolated Docker network and can expose services running in the Docker container that were previously isolated.

We can create a new file "custom-itds.yml" which contains the customization needed to run the iTDS in host networking mode. The file should have the following contents:

This will allow the iTDS to access services running on the host machine. Unfortunately this will break the communication between the "itdsphp" container and the "itdsdb" containers.

In order to fix this, you will need to add the following line to the "/etc/hosts" file on the host machine.

itdsdb localhost

This should be all the changes required to allow communication between the iTDS and a local transform server. You can run the server using the following command:

docker-compose -f itds.yml -f custom-itds.yml up

Include a Transform Server

If you would prefer to keep the default Docker bridged networking, you can add an additional "transforms" container to the docker-compose file. The iTDS will then be able to communicate directly to the transform server using the Docker networking.

We can create a new Dockerfile that will be used to build our transform server: