Skip to content

Instantly share code, notes, and snippets.

@manelclos
Last active August 1, 2017 10:06
Show Gist options
  • Save manelclos/390c2bc28cbd6279e234 to your computer and use it in GitHub Desktop.
Save manelclos/390c2bc28cbd6279e234 to your computer and use it in GitHub Desktop.
uwsgi ondemand config
[uwsgi]
procname-prefix-spaced=/apps/%c
chdir = %d/app
module = wsgi
need-app = true
# set enviroment variables from ini file. E.g. DB_PASSWORD=foobar
for-readline = %d/vars.ini
env = %(_)
endfor =
# define if needed
# venv = %d/env
# execution
# on-demand instances don't need to create the socket, the emperor will do
# socket = %d/uwsgi.sock
workers = 1
threads = 5
max-requests = 1000
cheap
idle = 60
die-on-idle = true
# logging
logto = %d/log.log
log-date = true
logfile-chown = true
log-backupname = %d/log.log.old
log-maxsize = 2500000
# system
uid = www-data
gid = www-data
buffer-size = 32768
master = true
chmod = 660
reload-os-env = true
auto-procname = true
no-orphans = true
die-on-term = true
DB_user=foo
DB_PASSWORD=bar
#! /bin/sh
#
# how can I turn config ini file into system environment in bash?
#
# credits: http://stackoverflow.com/a/22535251/593907
#
set -a # turn on automatic export
source vars.ini # execute all commands in the file
set +a # turn off automatic export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment