Skip to content

Commit aa1e820

Browse files
rothnicnroth-dealnewsmogery
authored
Fix corepack and self hosting setup (#1131)
* Update Dockerfile Config corepack and pnpm * Update Dockerfile Try using this approach: pnpm/pnpm#9029 (comment) * 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 <[email protected]> Co-authored-by: Gergő Móricz <[email protected]>
1 parent 73d19aa commit aa1e820

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

apps/api/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM node:20-slim AS base
2+
23
ENV PNPM_HOME="/pnpm"
34
ENV PATH="$PNPM_HOME:$PATH"
45
LABEL fly_launch_runtime="Node.js"
@@ -16,7 +17,7 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
1617
FROM base AS build
1718
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
1819

19-
RUN apt-get update -qq && apt-get install -y ca-certificates && update-ca-certificates
20+
RUN apt-get clean && apt-get update -qq && apt-get install -y ca-certificates && update-ca-certificates
2021
RUN pnpm install
2122
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
2223
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"
5354
# Make sure the entrypoint script has the correct line endings
5455
RUN sed -i 's/\r$//' /app/docker-entrypoint.sh
5556

56-
ENTRYPOINT "/app/docker-entrypoint.sh"
57+
ENTRYPOINT "/app/docker-entrypoint.sh"

apps/api/docker-entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash -e
22

33
if [ $UID -eq 0 ]; then
4+
set +e # disable failing on errror
45
ulimit -n 65535
56
echo "NEW ULIMIT: $(ulimit -n)"
7+
set -e # enable failing on error
68
else
79
echo ENTRYPOINT DID NOT RUN AS ROOT
810
fi

docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: firecrawl
22

33
x-common-service: &common-service
44
build: apps/api
5+
ulimits:
6+
nofile:
7+
soft: 65535
8+
hard: 65535
59
networks:
610
- backend
711
extra_hosts:

0 commit comments

Comments
 (0)