forked from shareAI-lab/Kode-Agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (51 loc) · 1.6 KB
/
Dockerfile
File metadata and controls
69 lines (51 loc) · 1.6 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Build stage
FROM node:22-alpine AS builder
# Configure Alpine to use China mirrors
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# Install build dependencies
RUN apk add --no-cache \
bash \
git \
python3 \
py3-pip \
make \
g++ \
curl
# Configure npm to use China registry
RUN npm config set registry https://registry.npmmirror.com/
# Configure pip to use Tsinghua mirror
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Verify files exist after build
RUN ls -la /app/
# Runtime stage
FROM node:22-alpine AS runtime
# Configure Alpine to use China mirrors
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# Install minimal runtime dependencies
RUN apk add --no-cache \
bash \
curl
# Configure npm to use China registry
RUN npm config set registry https://registry.npmmirror.com/
# Install production dependencies
WORKDIR /app
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
RUN npm ci --omit=dev
# Copy built artifacts
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/yoga.wasm /app/yoga.wasm
# Use workspace as default working directory for the CLI
WORKDIR /workspace
# Entry point executes the built CLI with workspace context
ENTRYPOINT ["node", "/app/dist/index.js", "-c", "/workspace"]