fix: docker volume permission issue and clean up unused dependencies

This commit is contained in:
zhayujie
2026-03-25 01:25:34 +08:00
parent 393f0c007c
commit 3eb8348708
7 changed files with 17 additions and 24 deletions

View File

@@ -17,8 +17,7 @@ RUN apt-get update \
&& cp config-template.json config.json \
&& /usr/local/bin/python -m pip install --no-cache --upgrade pip \
&& pip install --no-cache -r requirements.txt \
&& pip install --no-cache -r requirements-optional.txt \
&& pip install azure-cognitiveservices-speech
&& pip install --no-cache -r requirements-optional.txt
WORKDIR ${BUILD_PREFIX}
@@ -30,6 +29,4 @@ RUN chmod +x /entrypoint.sh \
&& useradd -r -g agent -s /bin/bash -d /home/agent agent \
&& chown -R agent:agent /home/agent ${BUILD_PREFIX} /usr/local/lib
USER agent
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -43,9 +43,15 @@ fi
# fi
# go to prefix dir
# fix ownership of mounted volumes then drop to non-root user
if [ "$(id -u)" = "0" ]; then
mkdir -p /home/agent/cow
chown agent:agent /home/agent/cow
exec su agent -s /bin/bash -c "cd $CHATGPT_ON_WECHAT_PREFIX && $CHATGPT_ON_WECHAT_EXEC"
fi
# fallback: already running as agent
cd $CHATGPT_ON_WECHAT_PREFIX
# excute
$CHATGPT_ON_WECHAT_EXEC