-
To wrap up this series, we’re going to set up monitoring and alerts to ensure our server stays healthy and responsive in production. Way back in Part 1, we enabled monitoring in our Terraform configuration by setting monitoring = true on our droplet. This installed the DigitalOcean metrics agent, which collects CPU, memory, and disk…
-
Now that our app is live and available through a custom domain, it’s time to take a crucial step toward production readiness: securing it with SSL encryption. 💡 Why SSL Matters SSL (Secure Sockets Layer) ensures that any data transferred between your users and your server is encrypted and private. Without it, all communication—like login…
-
The next step toward making our application production-ready is to secure it with SSL. But before we can do that, we need to set up a domain and point it to our server. If you don’t already have a domain, you’ll need to purchase one to follow along. There are affordable options available—some as cheap…
-
Now that our MySQL database is up and running, let’s refactor our Flask app to actually use it for storing todos. This will make our setup much closer to what you’d see in a real-world application. 🔧 Step 1: Update app.py to Use SQLAlchemy Open app/src/app.py and replace it with the following: 🧠 What’s Happening…
-
Now that we’ve got our Flask app running on Nginx with Gunicorn, it’s time to make things a little more “production-like” by adding a real database. In this part, we’ll install and configure MySQL using Ansible. 🧱 Step 1: Create the MySQL Role First, let’s create a new Ansible role to handle our MySQL installation.…
-
By now, we have a working deploy.yml Ansible playbook that deploys our Flask app to our server. But running this manually every time we push a change isn’t very DevOps, is it? In this part of the series, we’ll automate deployments using GitHub Actions so that every push to the main branch deploys our latest…
-
Now that everything is up and running, it’s time to add a simple deployment strategy using Ansible. This will allow us to push new versions of our app with a single command—and later we’ll automate it further using CI/CD. Let’s walk through how to: 📄 Step 1: Create the Deployment Playbook Inside your main ansible/…
-
🔁Building a Linux Web Server with Terraform & Ansible – Part 6: Connect Nginx and Flask
•
3 min read
Now that our Flask app is running with Gunicorn, it’s time to expose it to the world. In this article, we’ll configure Nginx as a reverse proxy to forward HTTP requests to our Gunicorn-powered Flask app over a UNIX socket. 🧱 Step 1: Create the Role We’ll create a new role specifically for setting up…
-
Now that we’ve got our server hardened and Nginx installed, it’s time to deploy a simple Flask web application and run it using Gunicorn. We’ll use Ansible to: Let’s dive in. 📁 Step 1: Set Up the Role Directory We’ll keep everything tidy by creating a new role: ⚙️ Step 2: Define Python Setup Tasks…
-
🌐 Building a Linux Web Server with Terraform & Ansible – Part 4: Installing and Configuring Nginx with Ansible
•
4 min read
In this article, we’ll install and configure Nginx as the web server for our project. Instead of configuring everything manually, we’ll use Ansible roles to make the process repeatable and clean. 📁 Step 1: Create the Nginx Role Let’s start by creating a new role for our Nginx configuration: Now add the role to your…