Docker Compose examples
Copy-ready Docker Compose files for monitoring, databases, web servers and apps, with sensible defaults already in place.
Open the Docker Compose template generator →
| Monitoring | |
|---|---|
| Monitoring stack | A complete single-host monitoring stack: Prometheus scraping itself and Node Exporter, Alertmanager for alerts, and Grafana with Prometheus already connected. |
| Prometheus | Prometheus with its config inline in the Compose file and a named volume for its data. |
| Grafana | Grafana with a named volume, an admin password and a Prometheus data source provisioned on start. |
| Node Exporter | Prometheus Node Exporter reading the host's CPU, memory, disk and network metrics. |
| Alertmanager | Prometheus Alertmanager with an inline starter config ready for Slack, email or webhook receivers. |
| Loki | Grafana Loki in single-binary mode with filesystem storage and 31-day retention. |
| Databases | |
| PostgreSQL | PostgreSQL with a named volume, a health check and the port published only on localhost. |
| MySQL | MySQL with a named volume, root and app users, a health check and the port published only on localhost. |
| MariaDB | MariaDB with a named volume, the image's built-in health check and the port published only on localhost. |
| MongoDB | MongoDB with authentication, a named volume, a health check and the port published only on localhost. |
| Redis | Redis with a password, append-only persistence on a named volume, and a health check. |
| Web servers | |
| Nginx web server | Nginx serving files from a local folder with a custom config inline in the Compose file. |
| Apache HTTP Server | Apache httpd serving files from a local folder. |
| Caddy reverse proxy with automatic HTTPS | Caddy in front of your app, getting and renewing Let's Encrypt certificates automatically. |
| Traefik reverse proxy with Let's Encrypt | Traefik routing to containers by label, redirecting HTTP to HTTPS and fetching Let's Encrypt certificates, with a sample whoami service. |
| Apps and messaging | |
| RabbitMQ | RabbitMQ with the management UI, a named volume and a health check. |
| WordPress with MySQL | WordPress and its MySQL database with named volumes, starting WordPress only once the database is healthy. |