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
- Open Food Facts product database ↗Open Database License (ODbL); images CC BY-SA
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
Write a Compose file with a reverse proxy (Caddy, Traefik or Nginx), the app and PostgreSQL with a named volume
Put the proxy and app on a front network and the app and database on an internal back network
Terminate TLS at the proxy and redirect HTTP to HTTPS; verify the certificate with curl
Add health checks and
restart: unless-stopped, and prove the stack recovers afterdocker killand a host rebootAdd a nightly backup container that dumps the database to a mounted directory
Deliverables
Repository with
compose.yaml,proxy/, a network diagram andREADME.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
| Criterion | Weight | What good looks like |
|---|---|---|
| Only the proxy is exposed; the database network is internal | 25% | |
| TLS works and plain HTTP redirects to HTTPS | 25% | |
| Health checks, restart policies and volumes survive restarts and reboots | 30% | |
| README and diagram | 20% |