-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 994 Bytes
/
Dockerfile
File metadata and controls
45 lines (34 loc) · 994 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Stage 1: Build the CLI binary
FROM debian:bookworm-slim AS builder
# Install dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js, pnpm and bun
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g pnpm@10.17.0 \
&& curl -fsSL https://bun.sh/install | bash
# Add bun to PATH
ENV PATH="/root/.bun/bin:${PATH}"
# Clone the repository
WORKDIR /app
COPY . .
# Build the monorepo
RUN pnpm install
RUN pnpm build
# Build the CLI binary
WORKDIR /app/packages/cli
RUN pnpm build:binary
# Stage 2: Create a minimal runtime image
FROM debian:bookworm-slim
# Copy the CLI binary from the builder stage
COPY --from=builder /app/packages/cli/dist/composio /composio
# Make the binary executable
RUN chmod +x /composio
# Create directory for user data
WORKDIR /root/.composio
# Set the entrypoint
ENTRYPOINT ["/composio", "--version"]