chore: optimize docker image build pipeline
All checks were successful
Build Docker Image / build (push) Successful in 5m4s
All checks were successful
Build Docker Image / build (push) Successful in 5m4s
This commit is contained in:
25
.dockerignore
Normal file
25
.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
||||
.git
|
||||
.gitignore
|
||||
.DS_Store
|
||||
*.log
|
||||
node_modules
|
||||
.pnpm-store
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
__pycache__
|
||||
*.pyc
|
||||
*.pyo
|
||||
.venv
|
||||
venv
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
coverage
|
||||
.coverage
|
||||
.nuxt
|
||||
.output
|
||||
dist
|
||||
build
|
||||
15
Dockerfile
15
Dockerfile
@@ -1,9 +1,11 @@
|
||||
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 prisma ./prisma
|
||||
RUN npx prisma generate
|
||||
@@ -12,16 +14,19 @@ COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine
|
||||
FROM deps AS runtime-deps
|
||||
|
||||
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/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder /app/node_modules/@prisma/client ./node_modules/@prisma/client
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY prisma ./prisma
|
||||
COPY scripts ./scripts
|
||||
|
||||
Reference in New Issue
Block a user