feat: add Dockerfile for self-hosted deployment

This commit is contained in:
Bruno Deanoz 2026-05-19 08:28:54 +02:00
parent c0fb41985e
commit dc8c3aa6f5
3 changed files with 33 additions and 0 deletions

9
.dockerignore Normal file
View file

@ -0,0 +1,9 @@
.git
node_modules
.next
.env.local
.env*.local
*.log
.DS_Store
tsconfig.tsbuildinfo
next-env.d.ts

23
Dockerfile Normal file
View file

@ -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"]

View file

@ -1,6 +1,7 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: "standalone",
headers: async () => [ headers: async () => [
{ {
source: "/(.*)", source: "/(.*)",