update: Update Dockerfile

mack-mac
mackt 8 months ago
parent c3dd02a261
commit e3673f23fa

@ -4,14 +4,14 @@ FROM node:alpine AS deps
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ 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 # Rebuild the source code only when needed
FROM node:alpine AS builder FROM node:alpine AS builder
WORKDIR /app WORKDIR /app
COPY . . COPY . .
COPY --from=deps /app/node_modules ./node_modules 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 # Production image, copy all the files and run next
FROM node:alpine AS runner FROM node:alpine AS runner

@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
// output: 'export', // output: 'export',
distDir: 'dist', // distDir: 'dist',
async rewrites() { async rewrites() {
return [ return [
{ {

Loading…
Cancel
Save