26 lines
510 B
Docker
26 lines
510 B
Docker
FROM node:20-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
ARG NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
|
|
ENV NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY
|
|
|
|
COPY package*.json ./
|
|
RUN --mount=type=cache,target=/root/.npm \
|
|
npm ci \
|
|
--prefer-offline \
|
|
--no-audit \
|
|
--fetch-retries=5 \
|
|
--fetch-retry-mintimeout=20000 \
|
|
--fetch-retry-maxtimeout=120000 \
|
|
--replace-registry-host=npmjs
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM alpine:3.21
|
|
|
|
WORKDIR /opt/frontend
|
|
|
|
COPY --from=build /app/dist ./dist
|