# Build container for Better-T-Stack monorepo using Bun on Node-based base image
FROM node:trixie
# Install system dependencies needed for building native modules and Bun
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
python3 \
curl \
git \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Install Bun (JS runtime and package manager used by this repo)
RUN bash -lc "curl -fsSL https://bun.sh/install | bash"
# Ensure Bun is in PATH
ENV PATH=/root/.bun/bin:$PATH
# Create a workdir for the repository and copy source code
WORKDIR /workspace
COPY . .
# Install dependencies using Bun with the frozen lockfile to ensure reproducible builds
RUN bun install --frozen-lockfile
# Build only the CLI workspace to avoid web build issues in this environment
RUN bun run build --filter=create-better-t-stack
# Default command: expose the built CLI binary
# The CLI is built to apps/cli/dist/cli.mjs; run with Node
CMD ["node", "apps/cli/dist/cli.mjs"]