Build out the Dockerfile

This commit is contained in:
The Shittinator
2026-02-22 20:06:04 -06:00
parent 2483b78212
commit c57965a035

View File

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