Skip to content

Instantly share code, notes, and snippets.

@rvegas
Created January 18, 2017 22:36
Show Gist options
  • Save rvegas/a1a5290c2b263bb1c4ae0b01f99ddc8f to your computer and use it in GitHub Desktop.
Save rvegas/a1a5290c2b263bb1c4ae0b01f99ddc8f to your computer and use it in GitHub Desktop.
keepcoding webinar 1 - resources

###Installations### sudo pip install flask
sudo pip install supervisor
sudo pip install gunicorn

###Running the microservice###

  • direct:python damage.py
  • gunicorn: gunicorn damage:app -w 4 -b 0.0.0.0:8000 --name==damage_service
  • supervisor: supervisorctl start damage_service o localhost:9001

###/usr/local/etc/supervisord.conf###

[unix_http_server]
file=/tmp/supervisor.sock
chmod=0700

[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = False
minfds = 1024
minprocs = 200
umask = 022
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp

[supervisorctl]
serverurl = unix:///tmp/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 123

[include]
files = /usr/local/share/supervisor/conf.d/*.conf /Users/ricardovegas/dev/webinars/rpg-services/supervisord.conf

###./supervisor.conf###

[program:damage_service]
command=gunicorn damage:app -w 4
process_name=%(program_name)s
directory=/Users/ricardovegas/dev/webinars/rpg-services

###Links###

###Bibliography###

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment