An awesome dependency management tool for python programming language. Which also makes it quite easier to manage the virtual environment for your python project. You can read more about Poetry and its installation here.
Glad you asked! If you have a python project that you want to run as a background service or daemon. You usually either use a service manager like systemd or you can use a terminal multiplexer like tmux or screen.
Read more on the topic here : How to run a python program as a background service ?
Here comes the good stuff. We will use systemd service manager to create background service for our python app. For our example we are trying to deploy a Flask app that uses poetry to manage dependencies and the virtual environment. Follow along, comrade :
Yes! I know it was simple. The approach is pretty much the same across all the background services you will ever make with systemd. Just find out the absolute executable path that will run your code with all dependencies. And that's pretty much it.
© 2021, All Rights Reserved · Vipin Joshi