mirror of
https://github.com/yamadashy/repomix.git
synced 2026-05-30 11:18:53 +02:00
768413dbea
The multi-stage build creates node_modules/@types/gtag.js as a directory in the deps stage (via npm ci), then COPY . . in the development stage tries to overlay local node_modules causing a file/directory type conflict. The .dockerignore approach is unreliable due to known Docker Compose + BuildKit issues, so use COPY --exclude=node_modules instead (requires BuildKit 1.7+). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
1022 B
Docker
33 lines
1022 B
Docker
# ==============================================================================
|
|
# Base stage
|
|
# ==============================================================================
|
|
FROM node:24-alpine AS base
|
|
|
|
# Install Git (required for VitePress)
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /app
|
|
|
|
# ==============================================================================
|
|
# Dependencies installation stage
|
|
# ==============================================================================
|
|
FROM base AS deps
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY package*.json ./
|
|
|
|
# Install all dependencies (with npm cache optimization)
|
|
RUN npm ci && npm cache clean --force
|
|
|
|
# ==============================================================================
|
|
# Development stage
|
|
# ==============================================================================
|
|
FROM deps AS development
|
|
|
|
# Copy source code (exclude node_modules to avoid conflict with deps stage)
|
|
COPY --exclude=node_modules . .
|
|
|
|
EXPOSE 5173
|
|
|
|
CMD ["npm", "run", "docs:dev"]
|