Deployments stuck on npm ci

guilhermethales
PRO

a year 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

guilhermethales
PRO

a year ago

49744f7b-acaf-4da5-b383-c7e318bd6635


a year ago

build logs please -


guilhermethales
PRO

a year ago


a year ago

can you share your package.json too please


guilhermethales
PRO

a year ago


a year ago

i assume this dockerfile builds locally?


guilhermethales
PRO

a year ago

it was building in prod


a year ago

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


guilhermethales
PRO

a year ago

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


guilhermethales
PRO

a year ago

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


a year ago

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


a year ago

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


guilhermethales
PRO

a year ago

I removed again the installation of chrome


guilhermethales
PRO

a year ago

but just show queued now

1266104057156731000


a year ago

how many builds do you have at once?


guilhermethales
PRO

a year ago

just 1


a year ago

do you have wait for ci enabled?


guilhermethales
PRO

a year ago

ohh, there's a lot builds in another environments


guilhermethales
PRO

a year ago

for each push to the master


guilhermethales
PRO

a year ago

I'll remove them


guilhermethales
PRO

a year ago

now it worked


guilhermethales
PRO

a year ago

I redeployed a deploy from yesterday, and it worked


guilhermethales
PRO

a year ago

I think it was because of too many builds running


guilhermethales
PRO

a year ago

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


guilhermethales
PRO

a year ago

thanks


a year ago

no problem!


Deployments stuck on npm ci - Railway Help Station