fix: move ENV PATH before npm ci to bust stale Docker cache layer
The cached npm ci layer predates the ENV PATH instruction, so tsc was never on PATH when the build ran. Moving ENV PATH earlier changes the cache key and forces a fresh install. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
# Stage 1: build TypeScript
|
# Stage 1: build TypeScript
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
ENV PATH="/app/node_modules/.bin:$PATH"
|
||||||
RUN apk add --no-cache python3 make g++
|
RUN apk add --no-cache python3 make g++
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci --include=dev
|
RUN npm ci --include=dev
|
||||||
ENV PATH="/app/node_modules/.bin:$PATH"
|
|
||||||
COPY tsconfig.json ./
|
COPY tsconfig.json ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN npm run build && npm prune --production
|
RUN npm run build && npm prune --production
|
||||||
|
|||||||
Reference in New Issue
Block a user