Deployments stuck on npm ci

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
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
18 Replies
Percy
Percy4mo ago
Project ID: 49744f7b-acaf-4da5-b383-c7e318bd6635
guilhermethales_
guilhermethales_OP4mo ago
49744f7b-acaf-4da5-b383-c7e318bd6635
Brody
Brody4mo ago
can you share your package.json too please
Brody
Brody4mo ago
i assume this dockerfile builds locally?
guilhermethales_
guilhermethales_OP4mo ago
it was building in prod
Brody
Brody4mo ago
is using browserless on the table for you? im thinking the hanging has to do with installing chrome
guilhermethales_
guilhermethales_OP4mo ago
I execute a crawler in the app, so I need to install it but I removed this apt-get as well and I got the same error
Brody
Brody4mo ago
I'm not sure how that would prevent you from using browserless puppeteer itself is installing chrome too, hence why I think it's freezing
guilhermethales_
guilhermethales_OP4mo ago
I removed again the installation of chrome
guilhermethales_
guilhermethales_OP4mo ago
but just show queued now
No description
Brody
Brody4mo ago
how many builds do you have at once?
guilhermethales_
guilhermethales_OP4mo ago
just 1
Brody
Brody4mo ago
do you have wait for ci enabled?
guilhermethales_
guilhermethales_OP4mo ago
ohh, there's a lot builds in another environments for each push to the master I'll remove them now it worked I redeployed a deploy from yesterday, and it worked I think it was because of too many builds running WHen I executed without the apt-get of chrome, didn't work the crawler thanks
Brody
Brody4mo ago
no problem!
Want results from more Discord servers?
Add your server