Oliver-ai-bot_2.0/backend/entrypoint.sh
Vadym Samoilenko 0f4ac447f8 fix: entrypoint.sh passes through args (needed for alembic in deploy.sh)
docker compose run --rm backend alembic upgrade head was starting gunicorn
instead of running alembic because entrypoint always ran gunicorn.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 18:18:33 +00:00

20 lines
501 B
Bash
Executable file

#!/bin/bash
set -e
export PYTHONPATH=/app:$PYTHONPATH
# If called with arguments (e.g. alembic upgrade head), execute them directly
if [ $# -gt 0 ]; then
exec "$@"
fi
echo "Starting Gunicorn with Uvicorn workers..."
exec gunicorn app.main:app \
--worker-class uvicorn.workers.UvicornWorker \
--workers "${WORKERS_COUNT:-4}" \
--bind 0.0.0.0:8000 \
--timeout 120 \
--graceful-timeout 30 \
--access-logfile - \
--error-logfile - \
--log-level "${LOG_LEVEL:-info}"