Hi,

I use gunicorn in my venv

I have quite few venv that run gunicorn.

I would like to reuse gunicorn for other venv

I launch my web application like this

#PWD = venv dir
source ./bin/activate
gunicorn A_WebApp:app
#A_WebApp is my python file A_WebApp.py

I supposes that gunicorn is a shell program ? if yes I should use $PATH ?
or gunicorn is a Python program only ? and then what I should do to use gunicorn in another venv ?

Thanks.

  • _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    If A_WebApp is truly the python file and app is some python symbol then you should be able to make gunicorn in another venv and call your script as such: path/to/venv/bin/python gunicorn A_Web_App:app

  • fraksken@infosec.pub
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 months ago

    It’s possible to make the venv portable, versionize it, archive it and deploy at boot the latest version. It’s architecture dependent though, so if you deploy on multiple archs, you will need to build for each.

    Edit: gunicorn is part of the venv. All you need to do after deploying gunicorn is activating the venv and running your server.

    You can also have the archive tun through several vulnerability checkers.