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

@@ -7,7 +7,18 @@ python -m app.wait_for_db
echo "[entrypoint] Migrationen einspielen ..."
alembic upgrade head
echo "[entrypoint] Starte API."
# --reload nur beim Entwickeln. Im Dauerbetrieb bringt es einen
# zusaetzlichen Ueberwachungsprozess, dauerndes Absuchen des
# Dateisystems - und es setzt voraus, dass der Quelltext ueber ein
# Bind-Mount hereinkommt statt aus dem gebauten Abbild.
if [ "${DEV_RELOAD:-false}" = "true" ]; then
echo "[entrypoint] Starte API im Entwicklungsmodus (--reload)."
RELOAD_ARG="--reload"
else
echo "[entrypoint] Starte API."
RELOAD_ARG=""
fi
# --proxy-headers: X-Forwarded-For auswerten, damit das Rate Limiting
# die echte Client-IP sieht und nicht die des nginx-Containers.
# --forwarded-allow-ips: nur diesen Absendern glauben. Der Wert ist
@@ -15,4 +26,4 @@ echo "[entrypoint] Starte API."
exec uvicorn app.main:app \
--host 0.0.0.0 --port 8000 \
--proxy-headers --forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-*}" \
--reload
${RELOAD_ARG}