Skip to content

Instantly share code, notes, and snippets.

@FGRibreau
Last active December 22, 2015 04:08
Show Gist options
  • Select an option

  • Save FGRibreau/6414542 to your computer and use it in GitHub Desktop.

Select an option

Save FGRibreau/6414542 to your computer and use it in GitHub Desktop.
How to make Play Framework 2 work with Supervisord and Monit
[program:myplayapp]
; remove -Dconfig.file if necessary (play will use the default application.conf)
; change address and port if necessary or remove them to use the default values
command=java -Xms128M -Xmx512m -cp .:./lib/*:./target/staged/* -Dhttp.address=127.0.0.1 -Dhttp.port=9000 -Dconfig.file=./conf/application.prod.conf play.core.server.NettyServer .
: directory to the play framework app, where "myapp/" is the root
directory=/dir/to/myapp
process_name=myplayapp
autorestart=true
startsecs=10
stopwaitsecs=10
check process myapp
with pidfile /dir/to/myapp/RUNNING_PID
start program = "/usr/bin/supervisorctl start myplayapp"
stop program = "/usr/bin/supervisorctl stop myplayapp"
if 10 restarts within 20 cycles
then timeout
if TOTALMEMORY > 2 GB for 4 cycles then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment