GeminiProChat icon indicating copy to clipboard operation
GeminiProChat copied to clipboard

dockers部署运行容器报错

Open tgy0728 opened this issue 1 year ago • 4 comments

How is Gemini Pro Chat deployed?

Docker

Describe the bug

把代码clone到本地后更改了两张图片改了下title,然后构建提交到本地镜像然后部署,run运行时提示Restarting (2) 1 second ago 始终启动不起来,并提示No such file or directoryr-env-replace.sh,尝试把CMD ["/bin/sh", "docker-entrypoint.sh"]的"/bin/sh"去掉,本地能启动成功,但是访问不了页面,去服务器部署了一遍,仍然是同样的结果。但是拉取作者的镜像就能启动访问,不知问题所在?

Console Logs

root@ip-172-31-30-138:/var/lib/docker# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3a8c9d3839aa c0bb89fc92e3 "docker-entrypoint.s…" 8 seconds ago Restarting (2) 1 second ago geminiprochat root@ip-172-31-30-138:/var/lib/docker# ^C root@ip-172-31-30-138:/var/lib/docker# docker logs 3a8c9d3839aa : not foundypoint.sh: line 2: : not foundypoint.sh: line 4: : not foundypoint.sh: line 6: ': No such file or directoryr-env-replace.sh : not foundypoint.sh: line 9: } : not foundypoint.sh: line 10: docker-entrypoint.sh: line 11: syntax error: unexpected word

Participation

  • [ ] I am willing to submit a pull request for this issue.

tgy0728 avatar Jan 02 '24 03:01 tgy0728

解决了,因为docker-entrypoint.sh和env-replace.sh格式在windows中与linux中不同,需使用git的转换工具进行格式转换。

tgy0728 avatar Jan 02 '24 06:01 tgy0728

解决了,因为docker-entrypoint.sh和env-replace.sh格式在windows中与linux中不同,需使用git的转换工具进行格式转换。

请问本地自行构建镜像的话,如何配置env呢?

KeyToLove avatar Jan 02 '24 08:01 KeyToLove

解决了,因为 docker-entrypoint.sh 和 env-replace.sh 格式在windows中与linux中不同,需使用git的转换工具进行格式转换。

请问本地自行构建镜像的话,如何配置env呢? 本地和linux都无需改动什么,.env里正常填api key就可以,不过如果也是clone下来的话,构建完运行容器没准会和我一样报错。

tgy0728 avatar Jan 02 '24 08:01 tgy0728

version: '3'

services: geminiprochat: image: 'babaohuang/geminiprochat:latest' container_name: geminiprochat restart: always ports: - "3000:3000" environment: - GEMINI_API_KEY=KEY # - HTTPS_PROXY=YOUR_HTTPS_PROXY # - API_BASE_URL=YOUR_GEMINI_API_BASE_URL # - HEAD_SCRIPTS=YOUR_HEAD_SCRIPTS # - PUBLIC_SECRET_KEY=YOUR_SECRET_KEY # - SITE_PASSWORD=YOUR_SITE_PASSWORD # - OPENAI_API_MODEL=YOUR_OPENAI_API_MODEL

改成这样就行 不报错

brucelau1987cn avatar Jan 31 '24 03:01 brucelau1987cn