chatgpt-web icon indicating copy to clipboard operation
chatgpt-web copied to clipboard

.env文件在docker哪个目录,怎么把环境变量.env文件使用-v映射到本地目录

Open goodnull opened this issue 1 year ago • 2 comments

使用下面命令也没有找到.env文件

docker exec -it chatgpt-web sh
find / -name .env

请问在.env文件的路径在哪? 我想使用-v映射.env文件到本地,这样我修改了环境变量,只需要重启容器即可 docker run -v /home/.env:/app/.env --name chatgpt-web chenzhaoyu94/chatgpt-web

goodnull avatar Apr 10 '23 09:04 goodnull

放当前目录就行了呀, 不需要挂载volume

docker run --rm --env-file .env --name chatgpt-web chenzhaoyu94/chatgpt-web

yuntao1997 avatar Apr 10 '23 12:04 yuntao1997

This issue is stale because it has been open for 10 days with no activity.

github-actions[bot] avatar Apr 21 '23 02:04 github-actions[bot]

放当前目录就行了呀, 不需要挂载volume

docker run --rm --env-file .env --name chatgpt-web chenzhaoyu94/chatgpt-web

老哥,我用的access-token,然后把token写入本地文件 ./myenv/chatgpt-web-service.env,执行: docker run --name chatgpt-web -d
-p 3002:3002
--env-file ./myenv/chatgpt-web-service.env
chatgpt-web-510

就是不行,报错[OpenAI] 提供错误的API密钥 | Incorrect API key provided

但如果直接: docker run --name chatgpt-web -d
-p 3002:3002
--env OPENAI_ACCESS_TOKEN=my_accesstoken
--env API_REVERSE_PROXY=http://172.17.0.1:8080/conversation
chatgpt-web-510

这样就可以正常使用。 myenv

why?

zhangbinhui avatar May 12 '23 03:05 zhangbinhui