-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathstartup.sh
More file actions
executable file
·22 lines (18 loc) · 984 Bytes
/
Copy pathstartup.sh
File metadata and controls
executable file
·22 lines (18 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -euo pipefail
# Default to production so gunicorn-based deployments fail closed on a missing
# or insecure JWT_SECRET. Override with OPENSHIELD_ENV=development only for
# local/demo runs launched via this script.
export OPENSHIELD_ENV="${OPENSHIELD_ENV:-production}"
echo "=== OpenShield startup ==="
echo "Applying database migrations..."
alembic upgrade head
echo "Startup complete. Starting Gunicorn web server..."
# NOTE: The scan worker is intentionally NOT started here. It runs as a
# separate Render background worker service (see render.yaml:
# openshield-worker / openshield-worker-staging, start command
# `python -m scanner.worker`). Keeping the worker out of the web container
# means restarting or scaling the web service does not kill the worker
# process; the standalone worker recovers stale scans on its own. Do not
# reintroduce a background worker subshell here.
exec gunicorn --bind=0.0.0.0:$PORT --timeout 120 --workers 2 api.app:application