Deploy python venv as snap

你。 提交于 2019-12-10 17:53:59

问题


We have a python(3) venv rest api. In the same venv we have also installed and configured the application server uwsgi the api is running on. And we are looking for a clean way to deploy it.

Until now we are deploying with is a simple script that creates the venv install the dependencies from pip and then runs the app.

I am wondering if using snap would be possible to package everything nicely and simply install them on a server.

Is that possible or a good practice to deploy a web api this way?

Thanks for your time.


回答1:


Yes, you can do this with snaps. You can use the python plugin module with snapcraft which extends your python path with a virtualenv.

Also, Its pretty easy to do this with a deb.

dh-virtualenv lets you use standard debian packaging tools. https://labs.spotify.com/2013/10/10/packaging-in-your-packaging-dh-virtualenv/

It is your choice.



来源:https://stackoverflow.com/questions/40116965/deploy-python-venv-as-snap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!