19 lines
625 B
Bash
19 lines
625 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
echo "[entrypoint] Warte auf Datenbank ${DB_HOST}:${DB_PORT} ..."
|
|
python -m app.wait_for_db
|
|
|
|
echo "[entrypoint] Migrationen einspielen ..."
|
|
alembic upgrade head
|
|
|
|
echo "[entrypoint] Starte API."
|
|
# --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
|
|
# unkritisch, solange der api-Container KEINEN oeffentlichen Port hat.
|
|
exec uvicorn app.main:app \
|
|
--host 0.0.0.0 --port 8000 \
|
|
--proxy-headers --forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-*}" \
|
|
--reload
|