Commit 0550f858 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

refactor: Dockerfile

parent f62e2f3b
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -2,19 +2,16 @@
FROM node:20.13.1 AS builder
ENV NODE_ENV=production
WORKDIR /app
# Install NPM with version
RUN npm install -g npm@10.8.0
# Install dependencies
COPY package*.json ./
ARG NPM_TOKEN
COPY package*.json ./
RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \
   npm ci --omit=dev && \
   rm -f .npmrc
# Build app
COPY . .
RUN npm run build

# --------------> The production image
FROM nginxinc/nginx-unprivileged:1.26.0 AS production
# Copy built assets from `builder` image
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/build/ /usr/share/nginx/html/