1 Star 0 Fork 1

eetuuuu/xiaozhi-esp32-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile-pip 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
欣南科技 提交于 2025-02-23 14:38 +08:00 . Doubao asr (#117)
# 第一阶段:前端构建
FROM node:18 AS frontend-builder
WORKDIR /app/ZhiKongTaiWeb
# 配置npm使用淘宝源
RUN npm config set registry https://registry.npmmirror.com
COPY ZhiKongTaiWeb/package*.json ./
# 安装axios依赖
RUN npm install axios
RUN npm install
COPY ZhiKongTaiWeb .
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/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui
# 复制应用代码
COPY . .
# 启动应用
CMD ["python", "app.py"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eetuuuu/xiaozhi-esp32-server.git
git@gitee.com:eetuuuu/xiaozhi-esp32-server.git
eetuuuu
xiaozhi-esp32-server
xiaozhi-esp32-server
main

搜索帮助