cli and setuptools wip
This commit is contained in:
parent
142050d804
commit
07852bdd98
17 changed files with 496 additions and 242 deletions
34
install.sh
34
install.sh
|
|
@ -50,23 +50,51 @@ sudo -iu ${APP_USER} bower --allow-root --config.cwd=${APP_DIR} --config.directo
|
|||
|
||||
sudo -iu ${APP_USER} virtualenv ${APP_DIR}/.venv
|
||||
|
||||
sudo -iu ${APP_USER} ${APP_DIR}/.venv/bin/pip install ${APP_DIR}
|
||||
cd ${APP_DIR} && sudo -iu ${APP_USER} ${APP_DIR}/.venv/bin/pip install -r ${APP_DIR}/requirements-dev.txt
|
||||
|
||||
echo "Installing start scripts"
|
||||
cat << EOF > /usr/local/bin/realms-wiki
|
||||
#!/bin/bash
|
||||
${APP_DIR}/.venv/bin/python ${APP_DIR}/manage.py "\$@"
|
||||
${APP_DIR}/realms-wiki "\$@"
|
||||
EOF
|
||||
|
||||
sudo chmod +x /usr/local/bin/realms-wiki
|
||||
|
||||
cat << EOF > /etc/init/realms-wiki.conf
|
||||
limit nofile 65335 65335
|
||||
|
||||
respawn
|
||||
|
||||
description "Realms Wiki"
|
||||
author "scragg@gmail.com"
|
||||
|
||||
chdir ${APP_DIR}
|
||||
|
||||
env PATH=${APP_DIR}/.venv/bin:/usr/local/bin:/usr/bin:/bin:$PATH
|
||||
env LC_ALL=en_US.UTF-8
|
||||
env GEVENT_RESOLVER=ares
|
||||
|
||||
export PATH
|
||||
export LC_ALL
|
||||
export GEVENT_RESOLVER
|
||||
|
||||
setuid ${APP_USER}
|
||||
setgid ${APP_USER}
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
respawn
|
||||
exec /usr/local/bin/realms-wiki run
|
||||
|
||||
exec gunicorn \
|
||||
--name realms-wiki \
|
||||
--access-logfile - \
|
||||
--error-logfile - \
|
||||
--worker-class gevent \
|
||||
--workers 2 \
|
||||
--bind 0.0.0.0:5000 \
|
||||
--user ${APP_USER} \
|
||||
--group ${APP_USER} \
|
||||
--chdir ${APP_DIR} \
|
||||
wsgi:app
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue