# stack-vue-ts — the container image a `runners.<role>.sandbox: container`
# role runs in when the project composes this pack (and no earlier pack in
# profile.extends ships an image) and sets no runners.<role>.sandbox_image
# (STORY-348 T-PB-348b, AC-2). lib/sandbox.sh builds it on first use as
# `harness-stack-vue-ts:<content hash>`; editing this file changes the tag.
#
# A Vue 3 + TypeScript front end needs only the Node toolchain: Node 22 (type
# stripping, which the vue-tsc / vitest gates do not need but node:test suites
# do), every corepack package manager (npm, pnpm, yarn — the pack leaves the
# choice to the repository), the engine's GNU userland and the agent client.
# A Vue SPA inside a Laravel application composes stack-laravel FIRST, and
# that pack's image carries Node too.
#
# HOME is a world-writable /home/agent (the container runs as the operator's
# uid on Linux hosts). AGENT_CLIENT_NPM='' builds without a client.
ARG NODE_VERSION=22
FROM node:${NODE_VERSION}-alpine

ARG PNPM_VERSION=10
ARG AGENT_CLIENT_NPM=@anthropic-ai/claude-code

ENV HOME=/home/agent \
    COREPACK_HOME=/opt/corepack \
    COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
    USE_BUILTIN_RIPGREP=0

RUN apk add --no-cache bash git jq ca-certificates coreutils findutils grep sed gawk \
      diffutils util-linux tar libgcc libstdc++ ripgrep \
 && corepack enable \
 && corepack prepare "pnpm@${PNPM_VERSION}" --activate \
 && chmod -R a+rX "$COREPACK_HOME" \
 && if [ -n "$AGENT_CLIENT_NPM" ]; then npm install -g --no-fund --no-audit $AGENT_CLIENT_NPM; fi \
 && npm cache clean --force \
 && rm -rf "$HOME" && mkdir -p "$HOME" && chmod 1777 "$HOME"

WORKDIR /workspace
CMD ["bash"]
