From 62eb6ce5d5b7dca13ce1c9d51344b8eed91e0b7e Mon Sep 17 00:00:00 2001 From: luo jiyin Date: Sat, 3 Aug 2024 21:49:48 +0800 Subject: [PATCH] build: slim-docker-github-action (#20) Co-authored-by: South Drifted --- Dockerfile | 11 +++++------ next.config.mjs | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec5863a..7d56991 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,16 +12,15 @@ RUN corepack enable COPY . /app WORKDIR /app -FROM base AS prod-deps -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i -P --frozen-lockfile --ignore-scripts - FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --frozen-lockfile RUN pnpm build FROM base -COPY --from=prod-deps /app/node_modules ./node_modules +COPY --from=build /app/.next/standalone ./ COPY --from=build /app/public ./public -COPY --from=build /app/.next ./.next +COPY --from=build /app/.next/static ./.next/static EXPOSE 3000 -CMD ["npm", "start"] \ No newline at end of file +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" +CMD ["node", "server.js"] \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 3f4269d..81c56f8 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -30,6 +30,7 @@ const withPWA = setPWA({ const nextConfig = withPWA( withLess( withMDX({ + output: 'standalone', pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], webpack: config => {