Files
WebApi/docker-entrypoint.sh
T

26 lines
984 B
Bash

#!/bin/sh
set -e
mkdir -p /data
# --no-sync: the image's environments were synced at build time; syncing at
# startup would try to reach the package index (and pull dev deps).
cd /app/Persistance
uv run --no-sync alembic -c persistance/cacu/alembic.ini upgrade head
uv run --no-sync alembic -c persistance/cama/alembic.ini upgrade head
uv run --no-sync alembic -c persistance/tea/alembic.ini upgrade head
uv run --no-sync alembic -c persistance/governance/alembic.ini upgrade head
cd /app/WebApi
# Container's own network namespace — no AirPlay conflict here, keep it on
# the port the Dockerfile EXPOSEs and docker-compose.yml maps from.
PORT="${PORT:-5000}"
# gunicorn, not Flask's development server. Long timeout: OCR over a
# multi-page scanned PDF runs inside a single request.
exec uv run --no-sync gunicorn \
--bind "0.0.0.0:${PORT}" \
--workers "${WEBAPI_WORKERS:-2}" \
--timeout "${WEBAPI_TIMEOUT:-600}" \
--access-logfile - \
"webapi:create_app()"