From 26763318045bddbbe048b11b25b17a5f77c67f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A3=E5=8D=97=E7=A7=91=E6=8A=80?= Date: Thu, 6 Mar 2025 10:55:01 +0800 Subject: [PATCH] Fix docker config bug (#217) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed:兼容旧版本docker * update:增加前端设计图 * update:dockerfile --------- Co-authored-by: hrz <1710360675@qq.com> --- Dockerfile | 29 +++++++++++++++++++++++++++++ main/README.md | 1 + 2 files changed, 30 insertions(+) create mode 100755 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 00000000..aaa43103 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# 第一阶段:构建Python依赖 +FROM python:3.10-slim AS builder + +WORKDIR /app + +COPY main/xiaozhi-server/requirements.txt . + +# 优化apt安装 +RUN pip install --no-cache-dir -r requirements.txt + +# 第三阶段:生产镜像 +FROM python:3.10-slim + +WORKDIR /opt/xiaozhi-esp32-server + +# 优化apt安装 +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 + +# 复制应用代码 +COPY main/xiaozhi-server/ . + +# 启动应用 +CMD ["python", "app.py"] \ No newline at end of file diff --git a/main/README.md b/main/README.md index 78c5f4a0..2e164954 100644 --- a/main/README.md +++ b/main/README.md @@ -20,3 +20,4 @@ xiaozhi-esp32-server [manager前后端接口协议](https://app.apifox.com/invite/project?token=H_8qhgfjUeaAL0wybghgU) +[前端页面设计图](https://codesign.qq.com/app/s/526108506410828)