Skip to content

Instantly share code, notes, and snippets.

@pmatseykanets
Created December 29, 2018 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatseykanets/13d0efd9b77370eac587fcdf9f7bb211 to your computer and use it in GitHub Desktop.
Save pmatseykanets/13d0efd9b77370eac587fcdf9f7bb211 to your computer and use it in GitHub Desktop.
Systemd config for a Go app
[Unit]
Description=App Name
After=network.target
[Service]
EnvironmentFile=-/usr/local/app/.env
ExecStart=/usr/local/app/current/app
WorkingDirectory=/usr/local/app/current
User=nobody
Group=nogroup
ProtectSystem=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE # lets `nobody` user bind ports 80, 443
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment