fix(docker-file): pump version dockerfile

This commit is contained in:
Thomas-xDo 2025-06-13 13:08:38 +07:00
parent fe60b25126
commit 551f824416

View file

@ -1,7 +1,7 @@
# Install dependencies only when needed # Install dependencies only when needed
FROM node:18-alpine AS deps FROM node:22-alpine3.21 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat git openssl1.1 RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./
# Add yarn timeout to handle slow CPU when Github Actions # Add yarn timeout to handle slow CPU when Github Actions
@ -9,7 +9,7 @@ RUN yarn config set network-timeout 300000
RUN yarn install --frozen-lockfile RUN yarn install --frozen-lockfile
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM node:18-alpine AS builder FROM node:22-alpine3.21 AS builder
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
@ -26,13 +26,12 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build-docker RUN yarn build-docker
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM node:18-alpine AS runner FROM node:22-alpine3.21 AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
RUN apk add --no-cache openssl1.1
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs