Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Fix corepack and self hosting setup (#1131)

Nick Rothaa1e820d5253
diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile
index af86e904e..c0bdbb58e 100644
--- a/apps/api/Dockerfile
+++ b/apps/api/Dockerfile
@@ -1,4 +1,5 @@
FROM node:20-slim AS base
+
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
LABEL fly_launch_runtime="Node.js"
@@ -16,7 +17,7 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
-RUN apt-get update -qq && apt-get install -y ca-certificates && update-ca-certificates
+RUN apt-get clean && apt-get update -qq && apt-get install -y ca-certificates && update-ca-certificates
RUN pnpm install
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
bash -c 'export SENTRY_AUTH_TOKEN="$(cat /run/secrets/SENTRY_AUTH_TOKEN)"; if [ -z $SENTRY_AUTH_TOKEN ]; then pnpm run build:nosentry; else pnpm run build; fi'
@@ -53,4 +54,4 @@ ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
# Make sure the entrypoint script has the correct line endings
RUN sed -i 's/\r$//' /app/docker-entrypoint.sh
-ENTRYPOINT "/app/docker-entrypoint.sh"
\ No newline at end of file
+ENTRYPOINT "/app/docker-entrypoint.sh"
diff --git a/apps/api/docker-entrypoint.sh b/apps/api/docker-entrypoint.sh
index a8bd3e2a0..0e8d72bb0 100755
--- a/apps/api/docker-entrypoint.sh
+++ b/apps/api/docker-entrypoint.sh
@@ -1,8 +1,10 @@
#!/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
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 24c007c2c..6594fb9ea 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -2,6 +2,10 @@ name: firecrawl
x-common-service: &common-service
build: apps/api
+ ulimits:
+ nofile:
+ soft: 65535
+ hard: 65535
networks:
- backend
extra_hosts: