FROM node:24-slim
USER root

# Cài đặt các công cụ lõi và thư viện biên dịch
RUN apt-get update && apt-get install -y python3 python3-pip git tmux curl build-essential && rm -rf /var/lib/apt/lists/*

# Cập nhật npm và cài đặt OpenClaw độc lập
RUN npm install -g npm@latest
RUN npm install -g openclaw@latest --force

# Cài đặt ClawTeam
RUN git clone https://github.com/HKUDS/ClawTeam.git /opt/clawteam
RUN cd /opt/clawteam && pip3 install --break-system-packages --no-cache-dir .
RUN chown -R node:node /opt/clawteam

# Cài đặt Superpowers và dọn dẹp kỹ năng xung đột
RUN git clone https://github.com/obra/superpowers.git /opt/superpowers
RUN rm -rf /opt/superpowers/skills/subagent-driven-development
RUN rm -rf /opt/superpowers/skills/dispatching-parallel-agents
RUN chown -R node:node /opt/superpowers

USER node

RUN echo 'alias oh="openclaw"' >> ~/.bashrc
