Question

Deploying docker and then wordpress, what about DNS ?

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.

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@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.