# OpenCode serve image + host tooling for interactive / worker agent sessions.
# Official image is Alpine and ships only the `opencode` binary.
FROM ghcr.io/anomalyco/opencode:latest

USER root

RUN apk add --no-cache \
      bash \
      ca-certificates \
      curl \
      git \
      github-cli \
      openssh-client \
      ripgrep \
      python3 \
      make \
      g++ \
      libc6-compat \
      nodejs \
      npm \
    && curl -fsSL -o /usr/local/bin/pnpm \
         https://github.com/pnpm/pnpm/releases/download/v9.15.9/pnpm-linuxstatic-x64 \
    && chmod +x /usr/local/bin/pnpm \
    && npm install -g tsx \
    && rm -rf /root/.npm/_cacache /tmp/*

ENV GIT_CONFIG_COUNT=1 \
    GIT_CONFIG_KEY_0=safe.directory \
    GIT_CONFIG_VALUE_0=*

WORKDIR /workspace
