mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
update:调试docker编译
This commit is contained in:
parent
4ea107c655
commit
47bb8f3efc
2 changed files with 5 additions and 30 deletions
4
.github/workflows/docker-image.yml
vendored
4
.github/workflows/docker-image.yml
vendored
|
|
@ -16,6 +16,10 @@ jobs:
|
||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check Disk Space
|
||||||
|
run: |
|
||||||
|
df -h
|
||||||
|
docker system df
|
||||||
- name: Clean up Docker resources
|
- name: Clean up Docker resources
|
||||||
run: |
|
run: |
|
||||||
docker system prune -af
|
docker system prune -af
|
||||||
|
|
|
||||||
31
Dockerfile
31
Dockerfile
|
|
@ -1,20 +1,4 @@
|
||||||
# 第一阶段:前端构建
|
# 第一阶段:构建 Python 依赖
|
||||||
|
|
||||||
FROM kalicyh/node:v18-alpine AS frontend-builder
|
|
||||||
|
|
||||||
WORKDIR /app/ZhiKongTaiWeb
|
|
||||||
|
|
||||||
# RUN corepack enable && yarn config set registry https://registry.npmmirror.com
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb/package.json ZhiKongTaiWeb/yarn.lock ./
|
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
COPY ZhiKongTaiWeb .
|
|
||||||
RUN yarn build
|
|
||||||
|
|
||||||
# 第二阶段:构建 Python 依赖
|
|
||||||
|
|
||||||
FROM kalicyh/poetry:v3.10_xiaozhi AS builder
|
FROM kalicyh/poetry:v3.10_xiaozhi AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -24,19 +8,6 @@ COPY . .
|
||||||
# 检查是否有缺失
|
# 检查是否有缺失
|
||||||
RUN poetry install --no-root
|
RUN poetry install --no-root
|
||||||
|
|
||||||
# 使用清华源加速apt安装,该镜像内置所以注释
|
|
||||||
# RUN rm -rf /etc/apt/sources.list.d/* && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
|
|
||||||
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security 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
|
|
||||||
|
|
||||||
# 从构建阶段复制虚拟环境和前端构建产物
|
|
||||||
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui
|
|
||||||
|
|
||||||
# 设置虚拟环境路径
|
# 设置虚拟环境路径
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue