dockerfile修复,修正权限问题

This commit is contained in:
GuanYuankai 2025-10-16 03:06:44 +00:00
parent 53d71c4bcb
commit af853a3146
1 changed files with 7 additions and 4 deletions

View File

@ -74,13 +74,16 @@ RUN cd /tmp/build-context/external/paho.mqtt.c && \
# 在所有 apt 操作完成后,最后进行清理
rm -rf /var/lib/apt/lists/*
COPY piper_models/ /app/piper_models/
# 5. 设置默认用户
# =================================
# 容器的默认用户将是 'dev'
USER dev
RUN pip install --no-cache-dir --user piper-tts
# 将 ~/.local/bin (包含 piper 二进制文件) 添加到 PATH
RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile
# 现在dev 用户可以使用 `piper` 命令了,只要 shell 环境被正确加载。
# 我们可以将最终的 CMD 设置为加载环境然后执行一个命令,或者留空让用户交互。
# 5. 设置默认用户
# =================================
# 容器的默认用户将是 'dev'
USER dev
CMD ["/bin/bash"]