Merge pull request #27 from beatz174-bit/codex/update-dockerfile-for-optimized-build-stage
Optimize Docker build cache for dependencies
This commit is contained in:
+3
-1
@@ -2,12 +2,14 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:20-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json* tsconfig*.json vite.config.ts ./
|
COPY package.json package-lock.json* ./
|
||||||
RUN --mount=type=cache,target=/root/.npm \
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
--mount=type=cache,target=/app/node_modules \
|
--mount=type=cache,target=/app/node_modules \
|
||||||
npm ci --no-audit --no-fund
|
npm ci --no-audit --no-fund
|
||||||
|
|
||||||
COPY index.html ./
|
COPY index.html ./
|
||||||
|
COPY tsconfig*.json ./
|
||||||
|
COPY vite.config.ts ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY public ./public
|
COPY public ./public
|
||||||
RUN --mount=type=cache,target=/app/node_modules npm run build
|
RUN --mount=type=cache,target=/app/node_modules npm run build
|
||||||
|
|||||||
Reference in New Issue
Block a user