Take the image live — and define the servers it runs on as version-controlled code.
Module 10 · Reproducible deployments, no clicking around.
Advanced Deploy & IaC Includes Lab ~60 minmain ships automaticallyPrerequisites: Module 9 (image built in CI). Deep dive: DevOps Lab: Infrastructure as Code and Real Cloud.
You don't test in front of your users. Real projects run the same app in separate environments, each with its own config and data:
| Environment | Purpose |
|---|---|
| Development | Your machine / containers — where you build. |
| Staging | A production-like copy for final checks before release. |
| Production | The live environment real users touch. |
Because Module 8 froze the app into an image, "deploy to production" just means "run that same image on the production host with production config." Same box, different environment variables.
The simplest real deployment: a small cloud VM with Docker installed, pulling your image and running it with Compose. In plain terms:
Doing this by hand once is fine for learning. But manual steps drift and get forgotten — which is exactly the problem Infrastructure as Code solves.
Clicking around a cloud console is the .env-in-the-repo of infrastructure: unrepeatable and impossible to review. Infrastructure as Code defines your servers in version-controlled files, so the whole environment is reproducible and diffable.
| Tool | Job |
|---|---|
| Terraform | Provision — create the VM, network, and firewall from code. |
| Ansible | Configure — install Docker and deploy the app onto that VM. |
The DevOps Lab IaC module and its sample-app/terraform and sample-app/ansible folders are a working template. Point your assistant at them, adapt for the vault, and review every line — infra code can cost real money if it's wrong.
An assistant will happily open a firewall to the world or hard-code a token. Infra is the highest-stakes place to take the wheel (Module 5). Read it like a hawk, and keep secrets in variables, never in the code.
The finish line of CD: extend your Module 9 pipeline so that when CI passes on main, it deploys automatically — pull the new image, restart the container. Now a merged pull request becomes a live release, hands-free, every time.
Idea → spec → build → test → gate → CI → deploy. From here, shipping a change is just merging a reviewed PR. That's the DevOps standard the whole course was building toward.
You'll deploy the vault to a real host and capture its infrastructure as code. A free-tier VM is ideal, but a managed container host works too — the goal is a public URL plus infra you can recreate from files.
Your GitHub repo from Module 9 (image building in CI) and a host to deploy to (a free-tier cloud VM, or a managed container platform).
Ask the assistant for a docker-compose.prod.yml that runs your published images with production env vars (from the host, not committed).
Review every line — especially firewall rules and any secrets.
Run your provision + configure steps (or your managed-host deploy). Open the app's public URL in a browser and create a snippet. It's live on the internet.
Add a deploy job to your CI workflow that runs on main after tests pass. Merge a tiny change and watch it deploy itself.
In REFLECTION.md: paste your live URL, and note one thing in the AI's infra code you had to tighten for safety. Commit.
Your repo plus the live URL. Self-check:
REFLECTION.md has the URL and a safety fix you made| Term | Plain meaning |
|---|---|
| Environment | A place the app runs: dev, staging, or production. |
| Provision | Create the servers/network the app needs. |
| Terraform | Tool to provision infrastructure from code. |
| Ansible | Tool to configure servers and deploy apps from code. |
| IaC | Infrastructure as Code — servers defined in version-controlled files. |
The snippet vault live on the internet, its infrastructure defined in reviewable code, and (optionally) a pipeline that deploys on every green merge. Your AI-built app is a real, shipped product.
Next up: Module 11 — Monitoring & Observability. Live isn't done — now we make the app tell you when it's healthy and when it's not, with logs, metrics, and alerts.