Last active
August 1, 2017 10:06
-
-
Save manelclos/390c2bc28cbd6279e234 to your computer and use it in GitHub Desktop.
uwsgi ondemand config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
procname-prefix-spaced=/apps/%c | |
chdir = %d/app | |
need-app = true | |
touch-reload = %d/uwsgi.ini | |
# old way | |
# module = wsgi | |
# new way | |
mount = /apps/appname=djangoapp/wsgi.py | |
manage-script-name = true | |
# set enviroment variables from ini file. | |
# http://stackoverflow.com/a/23733905/593907 | |
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 | |
auto-procname = true | |
no-orphans = true | |
vacuum = true | |
die-on-term = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_user=foo | |
DB_PASSWORD=bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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