From d0b20e3fab1734902358e208d1e2e58f30700a4f Mon Sep 17 00:00:00 2001 From: Adel HB Date: Fri, 6 Nov 2026 15:01:56 +0100 Subject: [PATCH] feat: add standalone output and Dockerfile for dokploy deployment --- Dockerfile | 27 +++++++++++++++++++++++++++ next.config.ts | 1 + 2 files changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fd57296 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:24-alpine AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +ENV NODE_ENV=production +RUN corepack enable + +FROM base AS deps +WORKDIR /app +COPY package.json pnpm-lock.yaml* ./ +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prod + +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN pnpm run build + +FROM base AS runner +WORKDIR /app +ENV NODE_ENV=production +RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +USER nextjs +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/next.config.ts b/next.config.ts index ebc157d..59164cb 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,7 @@ import type { NextConfig } from "next" const nextConfig: NextConfig = { /* config options here */ + output: "standalone", reactCompiler: true, experimental: { // Tailwind's CSS is small (~6 KB gzipped): inlined in the HTML, it no longer blocks the first