# Dockerfile-server-base
# 基础镜像，包含系统依赖和Python包
FROM python:3.10-slim

# Instalar dependências do sistema e configurar locale PT-BR
RUN apt-get update && \
    apt-get install -y --no-install-recommends libopus0 ffmpeg locales && \
    sed -i '/pt_BR.UTF-8/s/^# //g' /etc/locale.gen && \
    locale-gen && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Configurar variáveis de ambiente
ENV LANG=pt_BR.UTF-8 \
    LC_ALL=pt_BR.UTF-8 \
    LANGUAGE=pt_BR:pt \
    PYTHONIOENCODING=utf-8

WORKDIR /opt/xiaozhi-esp32-server

# Copiar o arquivo de requisitos
COPY main/xiaozhi-server/requirements.txt .

# Instalar dependências do Python usando o PyPI oficial (muito mais rápido no Brasil)
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir -r requirements.txt