Report this

What is the reason for this report?

Deploying docker and then wordpress, what about DNS ?

Posted on June 15, 2017

Hi,

So i found some tutorials for deploying docker to ubuntu - actually there is already a one click app for creating a docker image. Once this is done, I have found a tutorial for deploying mariadb and wordpress to the container. Although I am confused about dns ?

Do I need to configure DNS, via nginx or something ?

Anyone have any good examples ?

I was thinking of using an external DNS service. or do you have recommendations, I really dont want to have my own dns server.

Thanks in advance.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@ianjohnspain

Since Docker would be using internal IP addresses, you’d need to proxy incoming requests using NGINX (for example) to the Docker container. You’d simply point an A entry for the domain to the IP of your main Droplet IPv4 IP.

For example, your main IPv4 IP might be 104.112.113.45 and the internal IP for the container may be 10.20.11.15. In such a case, NGINX would accept incoming requests on the IPv4 IP for the Droplet, proxy them to the container IP and the container would handle the request from there.

NGINX (on the Droplet) would be setup to listen on port 80 while the container may be setup to listen on any port that you wish (such as port 8080). The only important step there would be to make sure that NGINX (on the Droplet) is setup to proxy to the correct port on the container.

Your DNS, in such a case, is no different than any other type of setup. You’ll still set the A entry for the domain to the IP of the Droplet and create your www CNAME to match, should you need it.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.