From 3017d612e3823dac1a72727fb41d7f7e18c56f60 Mon Sep 17 00:00:00 2001 From: Nazim Kri Date: Thu, 29 Oct 2026 21:31:32 -0400 Subject: [PATCH] Add standalone Docker build for Coolify deployment Co-Authored-By: Claude Sonnet 5 --- Dockerfile | 27 +++++++++++++++++++++++++++ next.config.ts | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dd5bbe3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# LokiLoto — Next.js 16 standalone, for Coolify. +FROM node:22-alpine AS base +RUN apk add --no-cache libc6-compat +WORKDIR /app + +FROM base AS deps +COPY package.json package-lock.json* ./ +RUN npm install --no-audit --no-fund --include=dev + +FROM base AS builder +COPY --from=deps /app/node_modules ./node_modules +COPY . . +ENV NEXT_TELEMETRY_DISABLED=1 +RUN npm run build + +FROM base AS runner +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 +ENV PORT=3000 +ENV HOSTNAME=0.0.0.0 +RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001 +COPY --from=builder /app/public ./public +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static +USER nextjs +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/next.config.ts b/next.config.ts index f4f290b..6678430 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + output: "standalone", cacheComponents: true, partialPrefetching: true, turbopack: {