chore: optimize docker image build pipeline
All checks were successful
Build Docker Image / build (push) Successful in 3m57s
All checks were successful
Build Docker Image / build (push) Successful in 3m57s
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,22 +1,27 @@
|
||||
FROM node:22-alpine AS builder
|
||||
FROM node:22-alpine AS deps
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
RUN npm install
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM deps AS builder
|
||||
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine
|
||||
FROM deps AS runtime-deps
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
FROM node:22-alpine AS runtime
|
||||
|
||||
RUN apk add --no-cache curl jq
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev
|
||||
COPY --from=runtime-deps /app/node_modules ./node_modules
|
||||
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY scripts ./scripts
|
||||
|
||||
Reference in New Issue
Block a user