diff --git a/start-with-env.sh b/start-with-env.sh new file mode 100755 index 0000000..867a71c --- /dev/null +++ b/start-with-env.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# PM2 wrapper that ensures defense env is always loaded, even on KeepAlive auto-restart +# Production fix for the recurring PM2 env-drop quirk. +set -a +[ -f /opt/llm-gateway/.env.defense ] && source /opt/llm-gateway/.env.defense +[ -f /opt/llm-gateway/.env ] && source /opt/llm-gateway/.env +set +a +exec /usr/bin/node /opt/llm-gateway/packages/gateway/dist/server.js