FROM python:3.12-slim

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PATH="/root/.ticloud/bin:${PATH}"

WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

# TiDB Cloud bulk export is server-side, but the currently supported control surface is
# the ticloud CLI. BigQuery/GCS work uses Google client libraries.
RUN curl -fsSL https://raw.githubusercontent.com/tidbcloud/tidbcloud-cli/main/install.sh | sh

COPY pyproject.toml README.md ./
COPY src ./src
COPY configs ./configs
COPY sql ./sql

RUN pip install --no-cache-dir .

ENTRYPOINT ["pingcap-pipeline"]
