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

[Feature] Optimization suggestions for python operating environment #7301

Open
xiahao90 opened this issue Dec 10, 2024 · 4 comments
Open

[Feature] Optimization suggestions for python operating environment #7301

xiahao90 opened this issue Dec 10, 2024 · 4 comments

Comments

@xiahao90
Copy link

xiahao90 commented Dec 10, 2024

1Panel Version

v1.10.21

Please describe your needs or suggestions for improvements

目前在创建python环境时需要填写启动命令,系统建议的是“请填写完整启动命令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000”,看其目的是安装扩展包与启动python程序一起执行。但是如此填写的话每次修改代码后重启都会执行一次pip install ,将会导致重启服务非常慢。
image

  • [ ]

Please describe the solution you suggest

目前应是填写完创建的输入框后后端程序会根据填写项自动生成dockerfile进行镜像编译运行。
建议增加一栏输入框:“选择requirements.txt”让用户进行选择,然后生成的dockerfile预计是下面的样子:
image

如此后只要没有修改过requirements.txt则不会重新安装,第一阶段会在docker中进行缓存,那么修改自己的python程序后进行重启则会快很多

Additional Information

No response

@wanghe-fit2cloud wanghe-fit2cloud changed the title [Feature] 关于python运行环境的优化建议 [Feature] Optimization suggestions for python operating environment Dec 10, 2024
@zhengkunwang223
Copy link
Member

当前没有编译 Dockerfile 是直接挂载的程序目录 然后启动的
后续版本会考虑把 pip install 的缓存目录挂载出来持久化 防止第二次启动继续下载

@wanghe-fit2cloud
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is currently no compiled Dockerfile. It is mounted directly to the program directory and then started.
Subsequent versions will consider mounting the cache directory of pip install for persistence to prevent continued downloading on the second startup.

@xiahao90
Copy link
Author

xiahao90 commented Feb 8, 2025

用python做web的人怎么少吗?没人反应

@wanghe-fit2cloud
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Why are there fewer people using python to make web? No one responded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants