Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

2.7 KB
Raw Blame
# Reusable Dockerfile for Deno e2e tests
# Usage: docker build -f Dockerfile.deno --build-arg DENO_VERSION=2.6.7 --build-arg NODE_MAJOR=22 -t test-name .
#
# Uses official denoland/deno images. For multi-version testing, run the build/run
# multiple times with different DENO_VERSION values from the shell script.
#
# Deno is the test matrix axis (base image); Node comes from nodesource (needed by
# pnpm and the build). bun and pnpm are installed from mise.toml/mise.lock, with
# node/deno disabled in mise so it does not shadow the base/nodesource binaries.

ARG DENO_VERSION

FROM denoland/deno:${DENO_VERSION}
ARG NODE_MAJOR

ENV MISE_DATA_DIR="/mise"
ENV MISE_CACHE_DIR="/mise/cache"
ENV MISE_DISABLE_TOOLS="node,deno,python,uv"
ENV MISE_TRUSTED_CONFIG_PATHS="/app"
ENV PATH="/mise/shims:$PATH"

# Switch to root for installation
USER root

WORKDIR /app

# Install system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends ca-certificates curl unzip && \
    rm -rf /var/lib/apt/lists/*

# Install Node.js (needed for pnpm's npm backend and building packages)
RUN curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

# Install bun + pnpm via mise (versions pinned in mise.toml/mise.lock).
# mise is installed to /usr/local/bin; its shared cache and shims keep the tools
# available to the non-root runtime user.
ENV XDG_CACHE_HOME="/mise/cache"
COPY .github/scripts/install-mise.sh ./.github/scripts/install-mise.sh
RUN MISE_INSTALL_PATH=/usr/local/bin/mise bash .github/scripts/install-mise.sh
COPY mise.toml mise.lock ./
RUN mise install && \
    pnpm --version && \
    bun --version

# Copy lockfile first for optimal layer caching
COPY pnpm-lock.yaml ./

# Copy workspace configuration files
COPY package.json \
     pnpm-workspace.yaml \
     .pnpmfile.cjs \
     tsconfig.base.json \
     tsdown.config.base.ts \
     toolchain-versions.json \
     ./

# Copy all ts/packages (pre-built)
COPY ts/packages/ ./ts/packages/

# Install dependencies using pnpm
# Note: We intentionally don't use --mount=type=cache for the pnpm store here
# because it causes native binding issues (e.g., rolldown-binding) across builds
RUN pnpm install --frozen-lockfile

# Copy e2e tests last (changes frequently)
COPY ts/e2e-tests/ ./ts/e2e-tests/

# Create deno user and group (to match the official image's user)
RUN groupadd -g 1000 deno 2>/dev/null || true && \
    useradd -u 1000 -g deno -m deno 2>/dev/null || true && \
    chown -R deno:deno /app

# Pre-create Deno cache directory
ENV DENO_DIR="/home/deno/.cache/deno"
RUN mkdir -p $DENO_DIR && chown -R deno:deno /home/deno

USER deno

RUN pnpm --version && \
    bun --version

CMD ["sh"]