Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.47 KB

README.rst

File metadata and controls

46 lines (37 loc) · 1.47 KB

api-hour-demo

Start manually

In this current folder, launch: api_hour -ac api-hour-demo:Container

Deploy using Ansible

  1. ansible-playbook ansible/install.yml -i ansible/inventory
  2. Customize config files in /etc/api-hour-demo/
  3. Merge rsyslog config file
  4. service api-hour-demo start

Deploy new version using Ansible

  1. ansible-playbook ansible/update.yml

Manual install

  1. Follow pythonz install doc: https://github.com/saghul/pythonz
  2. pythonz install 3.5.1
  3. cd /opt
  4. Git clone your app here
  5. cd /opt/api-hour-demo/
  6. /usr/local/pythonz/pythons/CPython-3.5.1/bin/pyvenv pyvenv
  7. . pyvenv/bin/activate
  8. pip install -r requirements.txt
  9. cd /etc/init.d/ && ln -s /opt/api-hour-demo/etc/init.d/api-hour-demo
  10. To define right boot order for your daemon (for example, your daemon needs PostgreSQL), customize file header of: /opt/api-hour-demo/etc/default/api-hour-demo
  11. cd /etc/default/ && ln -s /opt/api-hour-demo/etc/default/api-hour-demo
  12. update-rc.d api-hour-demo defaults
  13. cp -a /opt/api-hour-demo/etc/api-hour-demo /etc/
  14. Adapt rsyslog and logrotate
  15. For logrotate config file, apply the access rights: rw-r--r--
  16. service api-hour-demo start

To restart automatically daemon if it crashes

  1. apt-get install monit
  2. cd /etc/monit/conf.d/ && ln -s /opt/api-hour-demo/etc/monit/conf.d/api-hour-demo
  3. service monit restart