-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 690 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ARG NODE_VERSION=20
# Build stage
FROM node:${NODE_VERSION} AS builder
WORKDIR /app
# Set environment variable to force Rollup to use JS implementation
# This MUST be set before any npm commands
ENV ROLLUP_SKIP_NATIVE=1
# Create scripts directory and add static HTML generator
RUN mkdir -p scripts
# Copy generator script first
COPY scripts/generate-html.js ./scripts/
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --legacy-peer-deps
# Copy source code
COPY . .
# Build the application
RUN npm run build --verbose
# Export stage - creates a minimal image with just the build artifacts
FROM scratch AS export-stage
COPY --from=builder /app/dist /dist