mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 23:16:51 +00:00
feat: 仅对NEXT_BUILD_STANDALONE=true生效
This commit is contained in:
@@ -173,3 +173,4 @@
|
|||||||
# ENABLE_CACHE=
|
# ENABLE_CACHE=
|
||||||
# VERCEL_ENV=
|
# VERCEL_ENV=
|
||||||
# NEXT_PUBLIC_VERSION=
|
# NEXT_PUBLIC_VERSION=
|
||||||
|
# NEXT_BUILD_STANDALONE=
|
||||||
|
|||||||
@@ -14,16 +14,20 @@ RUN yarn install --frozen-lockfile
|
|||||||
# 2. Rebuild the source code only when needed
|
# 2. Rebuild the source code only when needed
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
ARG NOTION_PAGE_ID
|
ARG NOTION_PAGE_ID
|
||||||
|
ENV NEXT_BUILD_STANDALONE=true
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
# 3. Production image, copy all the files and run next
|
# 3. Production image, copy all the files and run next
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ const nextConfig = {
|
|||||||
eslint: {
|
eslint: {
|
||||||
ignoreDuringBuilds: true
|
ignoreDuringBuilds: true
|
||||||
},
|
},
|
||||||
output: process.env.EXPORT ? 'export' : 'standalone',
|
output: process.env.EXPORT ? 'export' : process.env.NEXT_BUILD_STANDALONE === 'true' ? 'standalone' : undefined,
|
||||||
staticPageGenerationTimeout: 120,
|
staticPageGenerationTimeout: 120,
|
||||||
// 多语言, 在export时禁用
|
// 多语言, 在export时禁用
|
||||||
i18n: process.env.EXPORT
|
i18n: process.env.EXPORT
|
||||||
|
|||||||
Reference in New Issue
Block a user