From 949a85bbaa440402d397993a77c1a3c4847bdf44 Mon Sep 17 00:00:00 2001 From: Affirm ThriveCo Date: Thu, 18 Jun 2026 17:30:59 +0000 Subject: [PATCH] chore: containerize for Coolify (standalone Docker build) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .dockerignore | 9 +++++++++ Dockerfile | 26 ++++++++++++++++++++++++++ next.config.mjs | 4 +++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5d3755b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +node_modules +.next +npm-debug.log +.git +.gitignore +README.md +.env*.local +screenshots +screencasts diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fb779f0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# syntax=docker/dockerfile:1 +FROM node:22-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json* ./ +RUN npm ci + +FROM node:22-alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +ENV NEXT_TELEMETRY_DISABLED=1 +RUN npm run build + +FROM node:22-alpine AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 +RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs +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 +ENV PORT=3000 +ENV HOSTNAME=0.0.0.0 +CMD ["node", "server.js"] diff --git a/next.config.mjs b/next.config.mjs index 4678774..8c8bab6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,6 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + output: "standalone", +}; export default nextConfig;