Commit 92a63a03 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

ci: npmrc - Dockerfile

parent f127bc0b
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
# --------------> The builder image
# The builder image
FROM node:23.6.0 AS builder
ENV NODE_ENV=production
WORKDIR /home/node/app
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
ARG NPM_TOKEN
RUN apt-get update && \
    apt-get install -y --no-install-recommends dumb-init && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
COPY package*.json ./
RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \
   npm ci --omit=dev && \
   rm -f .npmrc
RUN --mount=type=secret,id=npmrc,target=/home/node/.npmrc \
    npm ci --omit=dev

# --------------> The production image
# The production image
FROM node:23.6.0-slim AS production
ENV NODE_ENV=production
WORKDIR /home/node/app