Dockerfile: switch to bookworm-slim for native canvas builds
This commit is contained in:
parent
d702cdb611
commit
1eb1ef68c5
15
Dockerfile
15
Dockerfile
@ -1,16 +1,23 @@
|
||||
# Multi-stage build
|
||||
FROM node:20-alpine AS builder
|
||||
# Build stage
|
||||
FROM node:20-bookworm-slim AS builder
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
python3 make g++ pkg-config libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY package*.json ./
|
||||
RUN npm install --no-audit --no-fund
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
# Runtime stage
|
||||
FROM node:20-bookworm-slim
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libcairo2 libpango-1.0-0 libjpeg62-turbo libgif7 librsvg2-2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev --no-audit --no-fund && npm cache clean --force
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
EXPOSE 5000
|
||||
CMD ["npm", "run", "start"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user