Add Dockerfile and .dockerignore; configure Next.js output settings #31

Merged
kalana_Thilakarathna merged 1 commits from dev into production 2026-09-20 16:37:29 +05:30
3 changed files with 28 additions and 0 deletions
Showing only changes of commit 1579936baf - Show all commits
+5
View File
@@ -0,0 +1,5 @@
node_modules
.next
.git
.gitignore
*.md
+22
View File
@@ -0,0 +1,22 @@
FROM node:20-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
USER nextjs
EXPOSE 3000
ENV PORT=3000
CMD ["node", "server.js"]
+1
View File
@@ -6,6 +6,7 @@ const nextConfig: NextConfig = {
// with "Cannot read properties of undefined (reading 'appendChild')" on any page using
// LocationPicker. Production builds never double-invoke, so this only affects local dev.
reactStrictMode: false,
output: "standalone",
}
export default nextConfig