Files
xiaozhi-esp32-server/Dockerfile-server
T

30 lines
772 B
Plaintext
Raw Permalink Normal View History

2025-03-06 10:55:01 +08:00
# 第一阶段:构建Python依赖
FROM python:3.10-slim AS builder
WORKDIR /app
COPY main/xiaozhi-server/requirements.txt .
2025-03-27 15:39:11 +08:00
# 安装Python依赖
2025-03-06 10:55:01 +08:00
RUN pip install --no-cache-dir -r requirements.txt
2025-03-27 15:39:11 +08:00
# 第二阶段:生产镜像
2025-03-06 10:55:01 +08:00
FROM python:3.10-slim
WORKDIR /opt/xiaozhi-esp32-server
2025-03-27 15:39:11 +08:00
# 安装系统依赖
2025-03-06 10:55:01 +08:00
RUN apt-get update && \
apt-get install -y --no-install-recommends libopus0 ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 从构建阶段复制Python包和前端构建产物
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
2025-07-17 09:23:41 +08:00
COPY --from=builder /usr/local/bin/mcp-proxy /usr/local/bin/mcp-proxy
2025-03-06 10:55:01 +08:00
# 复制应用代码
2025-03-08 21:11:30 +08:00
COPY main/xiaozhi-server .
2025-03-06 10:55:01 +08:00
# 启动应用
CMD ["python", "app.py"]