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>
This commit is contained in:
Nick Roth 2025-02-05 03:19:11 -06:00 committed by GitHub
parent 73d19aa01b
commit aa1e820d52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -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"
ENTRYPOINT "/app/docker-entrypoint.sh"

View File

@ -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

View File

@ -2,6 +2,10 @@ name: firecrawl
x-common-service: &common-service
build: apps/api
ulimits:
nofile:
soft: 65535
hard: 65535
networks:
- backend
extra_hosts: