From dc8c3aa6f504bedb68ef067df23402df5565c43c Mon Sep 17 00:00:00 2001 From: Bruno Deanoz Date: Tue, 19 May 2026 08:28:54 +0200 Subject: [PATCH] feat: add Dockerfile for self-hosted deployment --- .dockerignore | 9 +++++++++ Dockerfile | 23 +++++++++++++++++++++++ next.config.ts | 1 + 3 files changed, 33 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f6065b8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +node_modules +.next +.env.local +.env*.local +*.log +.DS_Store +tsconfig.tsbuildinfo +next-env.d.ts diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa3521f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:22-alpine AS base +RUN corepack enable + +FROM base AS deps +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN node_modules/.bin/next build + +FROM base AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV PORT=3001 +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/public ./public +EXPOSE 3001 +CMD ["node", "server.js"] diff --git a/next.config.ts b/next.config.ts index 4578ca3..55e477d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,6 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { + output: "standalone", headers: async () => [ { source: "/(.*)",