Erste Produktivversion
This commit is contained in:
18
backend/entrypoint.sh
Normal file
18
backend/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user