Using Ansible and Terraform to automate Django app deployment with Docker: Part Three

James Vare Samuel
7 min readDec 23, 2022

Bonus: Learn how to secure the app using Let’s Encrypt Certificate Authority

We have finally come to the end of this series. From the first and second parts, we could test our application locally, configure our production application and eventually deploy using Ansible and Terraform to Digital Ocean.

Our deployed app uses an IP address Digital Ocean assigned to it. This IP address is how the internet locates the resources in a pool of public IP addresses. However, you don’t want to give out this IP address to people as we don’t expect people to always remember it. Imagine visiting websites with numbers; it will be difficult to remember every public IP address assigned to a resource online. So it is for this purpose that we require Domain names.

The Domain Name system maps out IP address resources to a human-readable name (Domain Name). It allows a user to locate any website on the internet.

What we have deployed to Digital Ocean can be called a resource, and this resource has an IP address assigned to it. Name servers are like directories that keep track of these resources and tell users how to find them on the world wide web.

For example, suppose you request a domain name called jotpad.com from a Domain Registrar and assign it to your IP address. In that case, a user will enter the string jotpad.com on their browser instead of an IP address 192.168.20.34 (A private…

--

--