How to deploy a full app with Docker Compose
Updated 7/20/2026
Here is how to deploy a real app: the web service, the database and a proxy that handles the domain and HTTPS, all with Docker Compose.
1. The structure
services:
app:
image: my-app:latest
environment:
DB_HOST: db
depends_on:
- db
db:
image: postgres:16
environment:
POSTGRES_PASSWORD: password
volumes:
- db_data:/var/lib/postgresql/data
volumes:
db_data:
2. Start
docker compose up -d
3. Add the domain and HTTPS
Put a reverse proxy in front. You can use Nginx (see Nginx as a reverse proxy) or Traefik, which generates certificates automatically (see Traefik for containers).
4. Updating
To update the app to a new version:
docker compose pull
docker compose up -d
5. Backup
Back up the database volume regularly, see container backups. With hourly billing you can test the deploy on a temporary server and delete it right away.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to free up disk space used by Docker
Images, stopped containers and orphaned volumes can fill your disk. Here is how to clean them up safely.
Updated 7/20/2026Docker & containersHow to run your own private Docker registry
Host your own Docker images on a private server, without depending on external services.
Updated 7/20/2026Docker & containersDocker security best practices
Run safer containers: non-root users, official images, limited resources and protected secrets.
Updated 7/20/2026