🎈 perf: 优化打包速度

注释日志的时间信息
This commit is contained in:
kalicyh 2025-02-18 15:45:58 +08:00
parent 188a7b8bb7
commit a5c8315c21
3 changed files with 14 additions and 13 deletions

View file

@ -11,7 +11,7 @@ COPY ZhiKongTaiWeb .
RUN yarn build RUN yarn build
# 第二阶段:构建 Python 依赖 # 第二阶段:构建 Python 依赖
FROM ccr.ccs.tencentyun.com/kalicyh/poetry:v3.10_latest AS builder FROM ccr.ccs.tencentyun.com/kalicyh/poetry:v3.10_xiaozhi AS builder
WORKDIR /app WORKDIR /app
@ -20,15 +20,15 @@ COPY . .
# 检查是否有缺失 # 检查是否有缺失
RUN poetry install --no-root RUN poetry install --no-root
# 使用清华源加速apt安装 # 使用清华源加速apt安装,该镜像内置所以注释
RUN rm -rf /etc/apt/sources.list.d/* && \ # 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 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-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/ 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 && \ # 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 update && \
apt-get install -y --no-install-recommends libopus0 ffmpeg && \ # apt-get install -y --no-install-recommends libopus0 ffmpeg && \
apt-get clean # apt-get clean
# 从构建阶段复制虚拟环境和前端构建产物 # 从构建阶段复制虚拟环境和前端构建产物
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui

View file

@ -9,7 +9,7 @@ def setup_logging(log_dir='tmp', data_dir='data'):
# 设置日志格式,时间、日志级别、标签、消息 # 设置日志格式,时间、日志级别、标签、消息
log_format = ( log_format = (
"<green>{time:YYYY-MM-DD HH:mm:ss}</green>" # "<green>{time:YYYY-MM-DD HH:mm:ss}</green>"
"[<light-blue>{extra[tag]}</light-blue>]" "[<light-blue>{extra[tag]}</light-blue>]"
" - <level>{level}</level> - " " - <level>{level}</level> - "
"<light-green>{message}</light-green>" "<light-green>{message}</light-green>"

View file

@ -1,11 +1,12 @@
services: services:
xiaozhi-esp32-server: xiaozhi-esp32-server:
image: ccr.ccs.tencentyun.com/xinnan/xiaozhi-esp32-server:latest image: ccr.ccs.tencentyun.com/kalicyh/esp32-ai-server:latest
container_name: xiaozhi-esp32-server container_name: xiaozhi-esp32-server
restart: always restart: always
#security_opt: #security_opt:
# - seccomp:unconfined # - seccomp:unconfined
ports: ports:
- "8000:8000" - "8000:8000"
- "8002:8002"
volumes: volumes:
- ./.config.yaml:/opt/xiaozhi-esp32-server/config.yaml - ./data:/app/data