How to deploy a full app with Docker Compose
Updated 10/23/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 run your own private Docker registry
Host your own Docker images on a private server, without depending on external services.
Updated 10/23/2026Docker & containersHow to read logs and debug Docker containers
When a container fails to start or stops on its own, the logs tell you why. Here is how to read and debug them.
Updated 10/23/2026Docker & containersHow 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 10/23/2026