Files
Kazuki Yamada 768413dbea fix(website): Use COPY --exclude to avoid node_modules conflict in client Dockerfile
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>
2026-03-21 21:54:16 +09:00

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"]