Skip to content

The platform for continuously improving AI agents.

712 B
Raw Blame
#!/bin/sh
# Migrate before any Django process.
# Disable with RUN_DB_BOOTSTRAP=0 (e.g. production where migrate runs in CI).
set -e

if [ "${RUN_DB_BOOTSTRAP:-1}" = "1" ]; then
  echo "==> migrate"
  python manage.py migrate --noinput
fi

# Instrument with New Relic only when the license key is injected (production:
# NEW_RELIC_LICENSE_KEY comes from Secrets Manager, NEW_RELIC_APP_NAME from the
# ECS task definition). The agent reads both from the environment — no config
# file needed. Wrapping here covers web and celery regardless of the container
# command; local/dev runs without the key are untouched.
if [ -n "${NEW_RELIC_LICENSE_KEY}" ]; then
  set -- newrelic-admin run-program "$@"
fi

exec "$@"