|
|
|
@ -4,14 +4,14 @@ FROM node:alpine AS deps
|
|
|
|
|
RUN apk add --no-cache libc6-compat
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
|
RUN yarn install --frozen-lockfile --registry=https://registry.npm.taobao.org
|
|
|
|
|
RUN npm install --frozen-lockfile --registry=https://registry.npm.taobao.org
|
|
|
|
|
|
|
|
|
|
# Rebuild the source code only when needed
|
|
|
|
|
FROM node:alpine AS builder
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY . .
|
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
|
|
|
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline --registry=https://registry.npm.taobao.org
|
|
|
|
|
RUN npm run build && npm install --production --ignore-scripts --prefer-offline --registry=https://registry.npm.taobao.org
|
|
|
|
|
|
|
|
|
|
# Production image, copy all the files and run next
|
|
|
|
|
FROM node:alpine AS runner
|
|
|
|
|