Deployments stuck on npm ci

AnonymousTRIAL

9 months ago

Today my deployments stopped working, always hanging on npm install. I've made a bunch of changes to try to solve it, but I couldn't fix yet. Could you help me?

Everything was working perfectly until today.

My dockerfile:

FROM --platform=linux/amd64 node:20.11.0

RUN apt-get update && apt-get install gnupg wget -y && \
    wget -q -O- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
    sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
    apt-get update && \
    apt-get install google-chrome-stable -y --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true


WORKDIR /app

COPY package*.json ./

ARG NODE_ENV=development

ENV NODE_ENV=${NODE_ENV}

RUN npm ci --include=dev

COPY . .

RUN if [ "$NODE_ENV" = "production" ] || [ "$NODE_ENV" = "staging" ]; then npm run build; fi

CMD if [ "$NODE_ENV" = "production" ] || [ "$NODE_ENV" = "staging" ]; \
        then sleep 3 && npm run start:main; \
        else npm run start:dev; \
    fi

0 Replies

AnonymousTRIAL

9 months ago

49744f7b-acaf-4da5-b383-c7e318bd6635


9 months ago

build logs please -


AnonymousTRIAL

9 months ago


9 months ago

can you share your package.json too please


AnonymousTRIAL

9 months ago


9 months ago

i assume this dockerfile builds locally?


AnonymousTRIAL

9 months ago

it was building in prod


9 months ago

is using browserless on the table for you? im thinking the hanging has to do with installing chrome


AnonymousTRIAL

9 months ago

I execute a crawler in the app, so I need to install it


AnonymousTRIAL

9 months ago

but I removed this apt-get as well and I got the same error


9 months ago

I'm not sure how that would prevent you from using browserless


9 months ago

puppeteer itself is installing chrome too, hence why I think it's freezing


AnonymousTRIAL

9 months ago

I removed again the installation of chrome


AnonymousTRIAL

9 months ago

but just show queued now

1266104057156731000


9 months ago

how many builds do you have at once?


AnonymousTRIAL

9 months ago

just 1


9 months ago

do you have wait for ci enabled?


AnonymousTRIAL

9 months ago

ohh, there's a lot builds in another environments


AnonymousTRIAL

9 months ago

for each push to the master


AnonymousTRIAL

9 months ago

I'll remove them


AnonymousTRIAL

9 months ago

now it worked


AnonymousTRIAL

9 months ago

I redeployed a deploy from yesterday, and it worked


AnonymousTRIAL

9 months ago

I think it was because of too many builds running


AnonymousTRIAL

9 months ago

WHen I executed without the apt-get of chrome, didn't work the crawler


AnonymousTRIAL

9 months ago

thanks


9 months ago

no problem!