fix
This commit is contained in:
1 parent
6f661b9365
commit
c8f89a7907
2 files changed
+6
-22
No files matched your search
@@ -1,27 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# ---- deps: instala dependencias (capa cacheable) ----
|
||||
FROM node:22-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# ---- build: compila Next.js en modo standalone ----
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Variables NEXT_PUBLIC_* se incrustan en el bundle del cliente en build-time,
|
||||
# por eso llegan como build-arg (desde docker-compose) y no solo como env de
|
||||
# runtime del contenedor final.
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# ---- runtime: imagen final mínima (next.config.ts tiene output: "standalone") ----
|
||||
FROM node:22-alpine AS runtime
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
Reference in new issue
Block a user