mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 00:23:53 +08:00
* 🦄 refactor(web): 修改zhikongtaiweb到web * 🦄 refactor: 重写前端 路由守护尚未写完 * 🦄 refactor: 标准化路由 * update:前端重写,保留后端 * update:添加前端代码 * update:pip转成poetry启动 * update:增加mem0ai包依赖 * update:文档增加mem0ai的描述 * feat: play online mp3 (#181) Co-authored-by: 欣南科技 <huangrongzhuang@xin-nan.com> * 修改前端代码 * update:调整项目目录 * update:优化 * update:配置文件去除8002端口 * update:增加开发说明 * update:更新开发协议 --------- Co-authored-by: kalicyh <34980061+kaliCYH@users.noreply.github.com> Co-authored-by: hrz <1710360675@qq.com> Co-authored-by: freshlife001 <talent@mises.site> Co-authored-by: CGD <3030332422@qq.com>
51 lines
1.3 KiB
Plaintext
Executable File
51 lines
1.3 KiB
Plaintext
Executable File
# 第一阶段:前端构建
|
|
FROM node:18 AS frontend-builder
|
|
|
|
WORKDIR /app/web
|
|
|
|
# 配置npm使用淘宝源
|
|
RUN npm config set registry https://registry.npmmirror.com
|
|
|
|
COPY web/package*.json ./
|
|
|
|
# 安装axios依赖
|
|
RUN npm install axios
|
|
RUN npm install
|
|
|
|
COPY web .
|
|
|
|
RUN npm run build
|
|
|
|
# 第二阶段:构建Python依赖
|
|
FROM python:3.10-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
|
|
# 优化apt安装
|
|
RUN pip install --no-cache-dir -r requirements.txt \
|
|
-i https://mirrors.aliyun.com/pypi/simple/
|
|
|
|
# 第三阶段:生产镜像
|
|
FROM python:3.10-slim
|
|
|
|
WORKDIR /opt/xiaozhi-esp32-server
|
|
|
|
# 优化apt安装
|
|
RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
|
|
echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
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 --from=frontend-builder /app/web/dist /opt/xiaozhi-esp32-server/manager/static/webui
|
|
|
|
# 复制应用代码
|
|
COPY . .
|
|
|
|
# 启动应用
|
|
CMD ["python", "app.py"] |