Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker imge issues #419 #425 #426

Merged
merged 2 commits into from
Jan 13, 2024
Merged

Conversation

isanwenyu
Copy link
Contributor

这个提交的内容总结如下:

Dockerfile文件的更改
使用清华镜像源进行pip安装时,更新了Dockerfile中的命令
更新了入口点,以使用正确的Python虚拟环境路径启动应用程序

@isanwenyu
Copy link
Contributor Author

测试镜像:isanwenyu/xiaogpt:latest

@yihong0618
Copy link
Owner

清华源我觉得合理,因为海外用户也用不了这个。@frostming 你感觉呢?

@@ -14,4 +14,4 @@ ENV XDG_CONFIG_HOME=/config
ENV XIAOGPT_PORT=9527
VOLUME /config
EXPOSE 9527
ENTRYPOINT [".venv/bin/python3","xiaogpt.py"]
ENTRYPOINT ["/app/.venv/bin/python3", "xiaogpt.py"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@frostming
Copy link
Collaborator

docker 镜像是 ci 负责 build,用户只用拉就行了 镜像里依赖都装好了不需要请求 pypi

退一步,即使需要换源,也是通过参数或环境变量去切换,而不是硬编码

@yihong0618
Copy link
Owner

docker 镜像是 ci 负责 build,用户只用拉就行了 镜像里依赖都装好了不需要请求 pypi

退一步,即使需要换源,也是通过参数或环境变量去切换,而不是硬编码

嗯嗯,合理,@isanwenyu 你能保留最后的部分,换源改成参数么?谢谢

@isanwenyu
Copy link
Contributor Author

@yihong0618 如果在安装依赖时构建失败或安装缓慢时,可以在构建 Docker 镜像时使用 --build-arg 参数来指定国内源地址:

docker build --build-arg PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple -t xiaogpt .

@yihong0618 yihong0618 merged commit 2258b88 into yihong0618:main Jan 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants