guilhermethales_
guilhermethales_
RRailway
Created by guilhermethales_ on 7/25/2024 in #✋|help
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
28 replies