Project · Beginner · about 12 hours

A production-like Compose stack with a TLS reverse proxy

Run a web app, its database and a reverse proxy with TLS in Docker Compose, with health checks, restart policies, private networks and persistent volumes.

Skills:Linux and Bash, Networking fundamentals, Docker and containers

Part of: DevOps / Platform Engineer, Cloud and Network Engineer

Data and licences

Brief

Many small products run on a single host with Docker Compose. Doing that well means TLS, isolation, health checks and data that survives restarts. Use the Open Food Facts catalogue app (or your own) as the application.

What to build

  1. Write a Compose file with a reverse proxy (Caddy, Traefik or Nginx), the app and PostgreSQL with a named volume

  2. Put the proxy and app on a front network and the app and database on an internal back network

  3. Terminate TLS at the proxy and redirect HTTP to HTTPS; verify the certificate with curl

  4. Add health checks and restart: unless-stopped, and prove the stack recovers after docker kill and a host reboot

  5. Add a nightly backup container that dumps the database to a mounted directory

Deliverables

  • Repository with compose.yaml, proxy/, a network diagram and README.md

How it is graded

Reviewers bring the stack up, check which ports are open from outside, kill containers and reboot the host.

Stretch

Add log shipping to a central location and a dashboard of request rates.

Deliverables

  • A Compose file with proxy, app, database and a backup job
  • TLS termination at the proxy with a certificate from a local CA or Let's Encrypt
  • Separate networks so the database is unreachable from the proxy
  • A README that explains every choice

How a reviewer grades it

CriterionWeightWhat good looks like
Only the proxy is exposed; the database network is internal25%
TLS works and plain HTTP redirects to HTTPS25%
Health checks, restart policies and volumes survive restarts and reboots30%
README and diagram20%