microsoft-vscode-copilot-chat
SUCCESS
12m 60s
History Source
SummaryIterations1Transcript7Dockerfile
Dockerfile32 lines · 1115 chars
# Stage 1: build the project from source
FROM node:22-bullseye-slim AS builder
WORKDIR /workspace

# Install build dependencies (Python for node-gyp, compilers)
RUN apt-get update \
    && apt-get install -y --no-install-recommends python3 python3-dev build-essential ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Copy dependencies manifest first to leverage Docker cache
COPY package.json package-lock.json ./

# Copy the rest of the repository
COPY . .

# Install dependencies and build
RUN npm ci
RUN npm run build

# Stage 2: runtime image
FROM node:22-bullseye-slim
WORKDIR /workspace

# Copy built artifacts and dependencies from the builder
COPY --from=builder /workspace/dist /workspace/dist
COPY --from=builder /workspace/node_modules /workspace/node_modules
COPY --from=builder /workspace/package.json /workspace/package-lock.json /workspace/
COPY --from=builder /workspace/script /workspace/script

# Expose a lightweight entrypoint that confirms the build
CMD ["bash", "-lc", "echo 'Copilot Chat build complete. Dist ready at /workspace/dist'; ls -la /workspace/dist || true; sleep infinity"]