xiaozhi-esp32-server/Dockerfile-server-base
lapy 2f92efd51f ci(docker): publish server images to GHCR; add server-base and app Dockerfiles
Workflows build and push thin server and web images; Dockerfiles match the downstream published image layout.
2026-04-25 17:05:06 +01:00

32 lines
1.2 KiB
Text

# Dockerfile-server-base
# Base image with system dependencies and Python packages (matches upstream layout;
# locale and comments are Western; pip install kept compatible with openai-whisper).
FROM python:3.10-slim
# System packages: audio stack + locales for UTF-8 (en_US, not zh_CN)
RUN apt-get update && \
apt-get install -y --no-install-recommends libopus0 ffmpeg locales && \
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Pip mirror and network resilience (same mirror family as upstream product)
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
pip config set global.trusted-host mirrors.aliyun.com && \
pip config set global.timeout 120 && \
pip config set install.retries 5
ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LANGUAGE=en_US:en \
PYTHONIOENCODING=utf-8
WORKDIR /opt/xiaozhi-esp32-server
COPY main/xiaozhi-server/requirements.txt .
# openai-whisper uses legacy setuptools hooks; pin setuptools and skip build isolation
RUN pip install --no-cache-dir --upgrade pip "setuptools<81" wheel && \
pip install --no-cache-dir --no-build-isolation -r requirements.txt --default-timeout=120 --retries 5