mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: docker volume permission issue and clean up unused dependencies
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user