Skip to content
Snippets Groups Projects
Commit 0550f858 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

refactor: Dockerfile

parent f62e2f3b
Branches
Tags
No related merge requests found
......@@ -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/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment