firecrawl/apps/api/docker-entrypoint.sh
Nick Roth aa1e820d52
Fix corepack and self hosting setup (#1131)
* Update Dockerfile

Config corepack and pnpm

* Update Dockerfile

Try using this approach: https://github.com/pnpm/pnpm/issues/9029#issuecomment-2631400936

* Add ulimits command to docker compose

* Remove ulimit from entrypoint

* Add ulimit back to docker-entrypoint.sh

This implements the proposed approach to not fail when the ulimit command can't run due to the environment

* Resolve signature mismatch

Resolves issue encountered when using docker compose up on a clean environment on an intel mac. This just adds the clean command to avoid leveraging any cached data before updating apt-get and installing ca-certificates

---------

Co-authored-by: Nick Roth <nroth@dealnews.com>
Co-authored-by: Gergő Móricz <mo.geryy@gmail.com>
2025-02-05 10:19:11 +01:00

25 lines
705 B
Bash
Executable File

#!/bin/bash -e
if [ $UID -eq 0 ]; then
set +e # disable failing on errror
ulimit -n 65535
echo "NEW ULIMIT: $(ulimit -n)"
set -e # enable failing on error
else
echo ENTRYPOINT DID NOT RUN AS ROOT
fi
if [ $FLY_PROCESS_GROUP = "app" ]; then
echo "RUNNING app"
node --max-old-space-size=8192 dist/src/index.js
elif [ $FLY_PROCESS_GROUP = "worker" ]; then
echo "RUNNING worker"
node --max-old-space-size=8192 dist/src/services/queue-worker.js
elif [ $FLY_PROCESS_GROUP = "index-worker" ]; then
echo "RUNNING index worker"
node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js
else
echo "NO FLY PROCESS GROUP"
node --max-old-space-size=8192 dist/src/index.js
fi