2024-09-27 20:44:52 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2025-02-18 21:33:20 +09:00
|
|
|
if [ "$UID" -eq 0 ]; then
|
2025-02-05 03:19:11 -06:00
|
|
|
set +e # disable failing on errror
|
2024-09-27 20:44:52 +02:00
|
|
|
ulimit -n 65535
|
|
|
|
echo "NEW ULIMIT: $(ulimit -n)"
|
2025-02-05 03:19:11 -06:00
|
|
|
set -e # enable failing on error
|
2024-09-27 20:44:52 +02:00
|
|
|
else
|
|
|
|
echo ENTRYPOINT DID NOT RUN AS ROOT
|
|
|
|
fi
|
|
|
|
|
2025-02-18 21:33:20 +09:00
|
|
|
if [ "$FLY_PROCESS_GROUP" = "app" ]; then
|
2024-09-27 22:16:27 +02:00
|
|
|
echo "RUNNING app"
|
2024-09-27 20:44:52 +02:00
|
|
|
node --max-old-space-size=8192 dist/src/index.js
|
2025-02-18 21:33:20 +09:00
|
|
|
elif [ "$FLY_PROCESS_GROUP" = "worker" ]; then
|
2024-09-27 22:16:27 +02:00
|
|
|
echo "RUNNING worker"
|
2024-09-27 20:44:52 +02:00
|
|
|
node --max-old-space-size=8192 dist/src/services/queue-worker.js
|
2025-02-18 21:33:20 +09:00
|
|
|
elif [ "$FLY_PROCESS_GROUP" = "index-worker" ]; then
|
2025-01-19 13:09:29 -03:00
|
|
|
echo "RUNNING index worker"
|
|
|
|
node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js
|
2024-09-27 20:44:52 +02:00
|
|
|
else
|
2024-09-27 22:16:27 +02:00
|
|
|
echo "NO FLY PROCESS GROUP"
|
2024-09-27 20:44:52 +02:00
|
|
|
node --max-old-space-size=8192 dist/src/index.js
|
|
|
|
fi
|