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

refactor: Dockerfile with versions for Dependabot

parent 86671471
Branches
Tags
No related merge requests found
# VERSIONS
ARG NODE_VERSION=20.13.1
ARG NGINX_VERSION=1.26.0
# --------------> The builder image # --------------> The builder image
FROM node:$NODE_VERSION AS builder FROM node:20.13.1 AS builder
ENV NODE_ENV=production ENV NODE_ENV=production
WORKDIR /app WORKDIR /app
# Install NPM with version # Install NPM with version
ARG NPM_VERSION=10.8.0 RUN npm install -g npm@10.8.0
RUN npm install -g npm@$NPM_VERSION
# Install dependencies # Install dependencies
COPY package*.json ./ COPY package*.json ./
ARG NPM_TOKEN ARG NPM_TOKEN
...@@ -18,8 +13,8 @@ RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \ ...@@ -18,8 +13,8 @@ RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \
# Build app # Build app
COPY . . COPY . .
RUN npm run build RUN npm run build
# --------------> The production image # --------------> The production image
FROM nginxinc/nginx-unprivileged:$NGINX_VERSION AS production FROM nginxinc/nginx-unprivileged:1.26.0 AS production
# Copy built assets from `builder` image # Copy built assets from `builder` image
COPY --from=builder /app/build/ /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