How to set environment variables in Supervisor service

To add a single environment variable, You can do something like this. [program:django] environment=SITE=domain1 command = python manage.py command But, if you want to export multiple environment variables, you need to separate them by comma. [program:django] environment = SITE=domain1, DJANGO_SETTINGS_MODULE=foo.settings.local, DB_USER=foo, DB_PASS=bar command = python manage.py command

Supervisor and Environment Variables

Referencing existing env vars is done with %(ENV_VARNAME)s See: https://github.com/Supervisor/supervisor/blob/master/supervisor/skel/sample.conf Setting multiple environment variables is done by separating them with commas See: http://supervisord.org/subprocess.html#subprocess-environment Try: environment=PYTHONPATH=/opt/mypypath:%(ENV_PYTHONPATH)s,PATH=/opt/mypath:%(ENV_PATH)s

Use of Supervisor in docker

while we can install multiple process without supervisor, only one process can be run when docker run is issued and when container is stopped only the PID 1 will be sent signals and other running process will not be stopped gracefully. Yes, although it depends on how your main process runs (foreground or background), and … Read more