restart-condition in container-services

This commit is contained in:
2026-08-09 11:17:30 +02:00
parent 7b21e2d1b4
commit dd51532533
6 changed files with 143 additions and 9 deletions

View File

@@ -36,9 +36,18 @@ services:
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/app
restart: "no"
# Kein Bind-Mount und kein --reload: Es laeuft der Code aus dem
# gebauten Abbild. Zum Entwickeln docker-compose.override.yml
# anlegen (Vorlage: docker-compose.override.yml.example).
healthcheck:
# Kein curl im python:slim-Abbild - deshalb ueber Python.
test: ["CMD", "python3", "-c",
"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3).status==200 else 1)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
restart: unless-stopped
networks: [einkaufsapp]
web: