From c57965a03545af4db80d48b717d4877000a3b669 Mon Sep 17 00:00:00 2001 From: The Shittinator <26260585-shittinator@users.noreply.gitlab.com> Date: Sun, 22 Feb 2026 20:06:04 -0600 Subject: [PATCH] Build out the Dockerfile --- Dockerfile | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ed41df..9e68d07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,28 @@ # # LMGCITFY Dockerfile # -FROM docker.io/library/node:22 AS prod -RUN npm install && \ - npm run build +ARG nodever=22 + +# STAGE 1: Build the application +FROM docker.io/library/node:$nodever-alpine AS builder +WORKDIR /app +ENV NEXT_TELEMETRY_DISABLED=1 +COPY package*.json ./ +RUN npm ci +COPY ./ ./ +RUN npm run build + +# STAGE 2: Prod build +FROM docker.io/library/node:$nodever-alpine AS prod +WORKDIR /app +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 +RUN addgroup -S nextjs && adduser -S nextjs -G nextjs +# Copy standalone server and assets +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/public ./public +# Jump in +USER nextjs EXPOSE 5000 -ENTRYPOINT [ "npm", "run", "start" ] +ENTRYPOINT [ "node", "server.js" ]