mirror of
https://github.com/ComposioHQ/composio.git
synced 2026-09-22 11:46:35 +08:00
1d02d3e495
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
46 lines
990 B
Docker
46 lines
990 B
Docker
# 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.8.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:bin
|
|
|
|
# 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"]
|