I don’t see any specific configuration for different OS deployments such as typical deployment modes for Windows and Linux with examples.
As an example configuring it to run on Linux as a SystemD service, my configuration looks like:
[Unit]
Description=My Service
After=network.target
[Service]
EnvironmentFile=/home/my-service/env
PIDFile=/home/my-service/app/RUNNING_PID
WorkingDirectory=/home/my-service/app/
ExecStart=/home/my-service/bin/my-service -Dplay.http.secret.key=$SCALA_MY_SERVICE_APP_SECRET
Restart=on-failure
User=my-service
Group=my-service
# See http://serverfault.com/a/695863
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
Are there any standard and recommended ways for deploying a Play app in a Linux env ?
Are there official configuration examples or recommended best-practices for deploying it as a service?
Why not include specific documentation for each OS (Linux, Windows) and have each one its own page in a separate section in the website under deployment?
@andyczerwonka I did check the link from sbt native packager regarding linux packaging, from what I understand it defines packaging options for Linux distributions such as generating deb or rpm files, the configuration I’m suggesting in this post is somewhat different as it’s basically taking a Play app binary distribution from the result of sbt dist and configuring it as a SystemD service on linux which would run the binary and would benefit from things such as automatic restart in case of failures, etc.
The packaging, whether .deb or .rpm, that’s just the package manager target. I deploy to ubuntu, and the distribution does exactly that and more… it packages it as a systemd service, creates the appropriate user and group, etc.