FROM golang:1.25-bookworm

RUN apt-get update \
  && apt-get install -y --no-install-recommends curl git openssh-client unzip default-mysql-client \
  && rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://bun.sh/install | bash

RUN curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
ENV PATH=/root/.bun/bin:/root/.tiup/bin:${PATH}
ENV GOPROXY=https://goproxy.cn,direct
ENV GOPRIVATE=github.com/pingcap/agent-git-service
ENV GONOSUMDB=github.com/pingcap/agent-git-service

WORKDIR /workspace/agentteam

COPY go.mod go.sum ./
COPY x/ ./x/
RUN go mod download

CMD ["make", "dev"]
