mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
fix(docker): build on node 20 to match CI and engines
The image was on node:22-alpine while CI pins node-version: 20 and package.json declares engines.node >=20.0.0. Align all three stages so the container builds and runs on the same major the project is tested against.
This commit is contained in:
parent
870cfb98f7
commit
b4fd27b181
@ -3,7 +3,7 @@
|
|||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# Stage 1 — install dependencies (cached until package*.json change)
|
# Stage 1 — install dependencies (cached until package*.json change)
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
FROM node:22-alpine AS deps
|
FROM node:20-alpine AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
@ -17,7 +17,7 @@ RUN npm ci
|
|||||||
# key, ENCRYPTION_KEY, META_APP_SECRET, ...) are read at runtime and
|
# key, ENCRYPTION_KEY, META_APP_SECRET, ...) are read at runtime and
|
||||||
# must NOT be baked into the image.
|
# must NOT be baked into the image.
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
FROM node:22-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
@ -37,7 +37,7 @@ RUN npm run build
|
|||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# Stage 3 — minimal runtime (standalone output)
|
# Stage 3 — minimal runtime (standalone output)
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
FROM node:22-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
NEXT_TELEMETRY_DISABLED=1 \
|
NEXT_TELEMETRY_DISABLED=1 \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user