Nueva actualizacion al dockerFile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -3,27 +3,31 @@ ENV PNPM_HOME="/pnpm"
|
|||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
# 1. Instalar herramientas del sistema para compilar sharp de forma nativa
|
# 1. Instalar herramientas nativas indispensables del sistema para compilar sharp
|
||||||
RUN apt-get update && apt-get install -y python3 build-essential gcc g++ make libc-dev && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y python3 build-essential gcc g++ make libc-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Instalar turbo globalmente para gestionar la compilación interna de forma directa
|
||||||
|
RUN pnpm add -g turbo
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# 2. Forzar compilación local de sharp para tu CPU
|
# 2. Forzar la compilación local de sharp saltándose restricciones de microarquitectura v2
|
||||||
ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1
|
ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1
|
||||||
|
|
||||||
# 3. Configurar arquitecturas nativas en PNPM
|
# 3. Configurar parámetros de arquitectura en el motor de PNPM
|
||||||
RUN pnpm config set supportedArchitectures.os linux
|
RUN pnpm config set supportedArchitectures.os linux
|
||||||
RUN pnpm config set supportedArchitectures.cpu x64
|
RUN pnpm config set supportedArchitectures.cpu x64
|
||||||
RUN pnpm config set supportedArchitectures.libc glibc
|
RUN pnpm config set supportedArchitectures.libc glibc
|
||||||
|
|
||||||
# 4. Instalar TODO (incluye devDependencies para poder usar nest build) sin bloquear el lockfile
|
# 4. Forzar instalación completa y regenerar enlaces binarios (Sintaxis compatible PNPM v10)
|
||||||
ENV CI=false
|
ENV CI=false
|
||||||
RUN pnpm install -w --config.frozen-lockfile=false
|
RUN pnpm install -w --config.frozen-lockfile=false
|
||||||
|
|
||||||
# 5. Compilar la aplicación NestJS usando Turbo
|
# 5. Ejecutar la compilación nativa delegada directamente en Turbo global
|
||||||
RUN pnpm turbo build --filter=api
|
RUN turbo build --filter=api
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -32,3 +36,4 @@ COPY --from=builder /app /app
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["pnpm", "--filter", "api", "start"]
|
CMD ["pnpm", "--filter", "api", "start"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user