# 轻量化 MCAP 转 LeRobot 转换器
# 无需外部 lerobot 包 - 使用内置 lerobot_minimal

FROM python:3.10-slim

# 使用国内镜像源加速
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \
  && sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \
  && mkdir -p /etc && \
  printf "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple\n" \
  > /etc/pip.conf

# 安装系统依赖（最小化）
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    libavformat-dev \
    libavcodec-dev \
    libswscale-dev \
    pkg-config \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制依赖文件
COPY requirements.txt /app/

# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt

# 复制应用代码
COPY src /app/src

# 设置入口点
ENTRYPOINT ["python", "src/convert.py"]
