Remote builder error too many files open

When I try to deploy via a remote builder, I get this error:


#0 73.38 [vite:css] [postcss] EMFILE: too many open files, open '/app/web/frontend/node_modules/@mantine/hooks/lib/use-focus-trap/scope-tab.d.ts'
#0 73.38 file: /app/web/frontend/index.css:undefined:undefined
#0 73.38 error during build:
#0 73.38 Error: [postcss] EMFILE: too many open files, open '/app/web/frontend/node_modules/@mantine/hooks/lib/use-focus-trap/scope-tab.d.ts'
#0 73.42 error Command failed with exit code 1.
#0 73.42 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/sh -c cd web/frontend && yarn install && yarn run build]: exit code: 1

I’m able to build locally, but I can’t use local building since I get another error. My project is not that big, so I don’t understand why I got this error. Is there any way to increase the capabilities of the builders?

I have pasted the Dockerfile with the separate build image. You can increase the number of file descriptors using ulimit -n <n>:

FROM debian:bullseye as builder

RUN apt-get update; apt install -y nodejs

RUN mkdir /app
WORKDIR /app

COPY . .

RUN ulimit -n 500000 && npm install && npm run build

FROM nginx

COPY --from=builder /app/build /app
COPY nginx.conf /etc/nginx/nginx.conf

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.