chore: optimize docker image build pipeline
All checks were successful
Build Docker Image / build (push) Successful in 6m3s
All checks were successful
Build Docker Image / build (push) Successful in 6m3s
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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm install
|
RUN npm ci
|
||||||
|
|
||||||
|
FROM deps AS builder
|
||||||
|
|
||||||
COPY prisma ./prisma
|
COPY prisma ./prisma
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
@@ -12,16 +14,19 @@ COPY tsconfig.json ./
|
|||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN npm run build
|
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
|
RUN apk add --no-cache curl jq
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
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 ./node_modules/.prisma
|
||||||
|
COPY --from=builder /app/node_modules/@prisma/client ./node_modules/@prisma/client
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY prisma ./prisma
|
COPY prisma ./prisma
|
||||||
COPY scripts ./scripts
|
COPY scripts ./scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user