Skip to content

Instantly share code, notes, and snippets.

@davidkeen
Last active October 17, 2018 13:16
Show Gist options
  • Save davidkeen/66c705bae458ef337e4a69372058bde5 to your computer and use it in GitHub Desktop.
Save davidkeen/66c705bae458ef337e4a69372058bde5 to your computer and use it in GitHub Desktop.
A systemd unit file for Play Framework
ADDRESS=127.0.0.1
PORT=9000
APPLY_EVOLUTIONS=true
APPLICATION_SECRET=my_secret
[Unit]
Description=My play app
After=network.target
[Service]
EnvironmentFile=/path/to/app/conf/env
PIDFile=/path/to/app/RUNNING_PID
WorkingDirectory=/path/to/app
ExecStart=/path/to/app/bin/play -Dhttp.address=${ADDRESS} -Dhttp.port=${PORT} -Dplay.evolutions.db.default.autoApply=${APPLY_EVOLUTIONS} -J-server
Restart=on-failure
User=play_user
Group=play_user
# See http://serverfault.com/a/695863
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment