How to use the Docker Compose Generator
- 1. Choose servicesPick an app type, a database, a cache and an optional Nginx proxy.
- 2. GenerateGet compose.yaml and a sample .env with connection strings.
- 3. Run itChange the passwords, then run docker compose up -d.
What the defaults build
The starting choices create 3 services: app built from your Dockerfile on port 3000, db running postgres:17-alpine, and cache running Redis 7, with two named volumes so data survives restarts. The app waits for the database with condition: service_healthy, and the database's health check runs pg_isready every 10 seconds, so the app does not start before Postgres accepts connections.
The .env part gives DB_USER, DB_PASSWORD and a ready DATABASE_URL that points at the host name db, because services on the same Compose network reach each other by service name.
Before you use it on a server
- Replace every change-me password and keep .env out of Git.
- Do not publish database ports on a public server; only the app or proxy should have a ports entry.
- Add an Nginx proxy if you want port 80 and a place to add HTTPS later. The app then uses expose instead of ports.
- The top-level
version:key is obsolete in the Compose Specification, so it is left out.
Image tags were current in November 2026; check Docker Hub for newer ones and pin a specific tag for production. Build the app image with the Dockerfile generator, and check the YAML with the YAML validator if you edit it by hand.
Frequently asked questions
Is compose.yaml or docker-compose.yml the right file name?
Both work. compose.yaml is the preferred name in the Compose Specification; the older name is still read.
Can I use this in production?
For a single server it is a reasonable start. For several servers or automatic failover, look at Kubernetes or a managed container service.
Is the Docker Compose Generator free?
Yes, the Docker Compose Generator is free. The first time you generate your first compose file, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.