Update Dockerfile

This commit is contained in:
DefectingCat
2022-07-21 18:02:01 +08:00
parent 075603ff61
commit 6acdb3fed8

View File

@ -17,7 +17,7 @@ RUN yarn install --frozen-lockfile
# RUN npm ci
# Rebuild the source code only when needed
FROM node:16-alpine AS builder
FROM node:lts-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
@ -33,7 +33,7 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# RUN npm run build
# Production image, copy all the files and run next
FROM node:16-alpine AS runner
FROM node:lts-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
@ -46,8 +46,8 @@ RUN adduser --system --uid 1001 nextjs
# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/.env ./
COPY --from=builder /app/next.config.mjs ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
# COPY --from=builder /app/public ./public
# COPY --from=builder /app/package.json ./package.json
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing