File size: 998 Bytes
3c6fc2a a59f28c f68d61b a59f28c fe2f79f 3c6fc2a fe2f79f 3c6fc2a a59f28c 3c6fc2a fe2f79f 3c6fc2a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/bin/bash
set -ex
echo "Running database migrations..."
pnpm --filter @repo/database db:push
# On Hugging Face (DISABLE_WORKER=true), only run the API.
# The WhatsApp worker runs exclusively on Railway and calls graph.facebook.com from there.
if [ "${DISABLE_WORKER}" != "true" ]; then
echo "Starting WhatsApp Worker..."
if [ -f "apps/whatsapp-worker/dist/src/index.js" ]; then
node apps/whatsapp-worker/dist/src/index.js &
elif [ -f "apps/whatsapp-worker/dist/index.js" ]; then
node apps/whatsapp-worker/dist/index.js &
else
echo "WARNING: WhatsApp Worker build output missing — worker not started."
fi
else
echo "DISABLE_WORKER=true — Skipping worker startup (HF inbound-only mode)."
fi
echo "Starting API..."
if [ -f "apps/api/dist/src/index.js" ]; then
exec node apps/api/dist/src/index.js
elif [ -f "apps/api/dist/index.js" ]; then
exec node apps/api/dist/index.js
else
echo "ERROR: API build output missing!"
exit 1
fi
|