Anexado DockerFile
Se anexa para repara error de sharp
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:20-slim AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
# Instalar herramientas necesarias para compilar sharp desde código fuente
|
||||
RUN apt-get update && apt-get install -y python3 build-essential gcc g++ make && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
# Forzar a sharp a ignorar binarios globales y compilar localmente
|
||||
ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm turbo build --filter=api
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=builder /app /app
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["pnpm", "--filter", "api", "start"]
|
||||
Reference in New Issue
Block a user