more plans
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 12m0s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 12m0s
This commit is contained in:
25
test-sx-web/entrypoint.sh
Executable file
25
test-sx-web/entrypoint.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# No database — skip DB wait and migrations
|
||||
|
||||
# Clear Redis page cache on deploy
|
||||
if [[ -n "${REDIS_URL:-}" && "${REDIS_URL}" != "no" ]]; then
|
||||
python3 -c "
|
||||
import redis, os
|
||||
r = redis.from_url(os.environ['REDIS_URL'])
|
||||
r.flushdb()
|
||||
" || echo "Redis flush failed (non-fatal), continuing..."
|
||||
fi
|
||||
|
||||
# Start the app
|
||||
RELOAD_FLAG=""
|
||||
if [[ "${RELOAD:-}" == "true" ]]; then
|
||||
RELOAD_FLAG="--reload"
|
||||
python3 -m shared.dev_watcher &
|
||||
fi
|
||||
PYTHONUNBUFFERED=1 exec hypercorn "${APP_MODULE:-app:app}" \
|
||||
--bind 0.0.0.0:${PORT:-8000} \
|
||||
--workers ${WORKERS:-1} \
|
||||
--keep-alive 75 \
|
||||
${RELOAD_FLAG}
|
||||
Reference in New Issue
Block a user