Docker Compose Production – VPS Setup mit SSL & Updates
Docker Compose in Produktion: .env, Volumes, Restart-Policies, Traefik SSL, Backups, Updates – komplette VPS-Anleitung.
Kurzantwort: Docker Compose Production = restart: unless-stopped, .env für Secrets, Traefik für SSL, tägliche Volume-Backups.
Wenn du hier landest: Dein Compose-Stack läuft lokal – du willst ihn sicher auf einem VPS in Deutschland betreiben.
Production-Template
`# docker-compose.yml services: app: image: ghcr.io/deinuser/deine-app:1.2.3 restart: unless-stopped env_file: .env networks:
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(
app.deinedomain.de)" - "traefik.http.routers.app.entrypoints=websecure"
- "traefik.http.routers.app.tls.certresolver=le"
db: image: postgres:16 restart: unless-stopped env_file: .env volumes:
- pgdata:/var/lib/postgresql/data
networks:
- internal
networks: web: internal: internal: true
volumes: pgdata:`
Deploy-Checkliste
- VPS einrichten → VPS Guide
- Docker installieren:
apt install docker.io docker-compose-v2 - UFW: 22, 80, 443 → Firewall
.envmit Secrets erstellendocker compose up -d- DNS A-Record → A-Record
- Backup-Cron einrichten
Weiterführend
VPS & Root Server: VPS in Deutschland bestellen · nexorahost.com (Maincubes FRA01 Frankfurt · Ryzen · NVMe)