mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 06:28:12 +00:00
remove Puppeteer from docker
This commit is contained in:
@@ -7,9 +7,6 @@ RUN apk add --no-cache libc6-compat
|
|||||||
# `--mount=type=cache,target=/pnpm/store` cache actually persists deps across builds.
|
# `--mount=type=cache,target=/pnpm/store` cache actually persists deps across builds.
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
# Puppeteer ships a glibc Chrome that cannot run on Alpine; skip the ~150MB
|
|
||||||
# download at install time. The runner stage installs Alpine's system Chromium.
|
|
||||||
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -35,23 +32,8 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|||||||
pnpm deploy --filter="@edr/freight-api" --prod --legacy /deploy
|
pnpm deploy --filter="@edr/freight-api" --prod --legacy /deploy
|
||||||
|
|
||||||
FROM node:24.15.0-alpine AS runner
|
FROM node:24.15.0-alpine AS runner
|
||||||
# Chromium + fonts for Puppeteer PDF rendering (contract/invoice/receipt docs).
|
RUN apk add --no-cache libc6-compat
|
||||||
# Without these, Puppeteer fails to launch and the code degrades to an
|
|
||||||
# unformatted plain-text PDF fallback. Use Alpine's system Chromium (musl-built);
|
|
||||||
# the glibc Chrome that `puppeteer install` downloads cannot run on Alpine.
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
libc6-compat \
|
|
||||||
chromium \
|
|
||||||
nss \
|
|
||||||
freetype \
|
|
||||||
harfbuzz \
|
|
||||||
ca-certificates \
|
|
||||||
ttf-freefont \
|
|
||||||
font-noto-cjk
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
# Point Puppeteer at the system Chromium and skip its bundled download.
|
|
||||||
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
|
||||||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN addgroup --system --gid 1001 nodejs \
|
RUN addgroup --system --gid 1001 nodejs \
|
||||||
&& adduser --system --uid 1001 --ingroup nodejs nestjs
|
&& adduser --system --uid 1001 --ingroup nodejs nestjs
|
||||||
@@ -61,3 +43,4 @@ EXPOSE 3001
|
|||||||
# GT06 GPS tracker TCP listener (raw TCP, not HTTP). Change via GT06_TCP_PORT.
|
# GT06 GPS tracker TCP listener (raw TCP, not HTTP). Change via GT06_TCP_PORT.
|
||||||
EXPOSE 5023
|
EXPOSE 5023
|
||||||
CMD ["node", "dist/main.js"]
|
CMD ["node", "dist/main.js"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user