Skip to content

Instantly share code, notes, and snippets.

@bketelsen
Created December 5, 2017 20:10
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bketelsen/b6f8123cf66d1edd602c50a0b5a549f5 to your computer and use it in GitHub Desktop.
Save bketelsen/b6f8123cf66d1edd602c50a0b5a549f5 to your computer and use it in GitHub Desktop.
systemd unit file for a go web app
# /etc/systemd/system/gaweb.service
[Unit]
Description=gopheracademy website
[Service]
PIDFile=/tmp/gaweb.pid-3001
User=gaweb
Group=gaweb
Environment=GO_ENV=production
Environment=POSTGRES_PASSWORD=SomePassWord
Environment=PORT=3001
WorkingDirectory=/home/gaweb/go/src/github.com/bketelsen/gaweb
ExecStart=/bin/bash -c '/home/gaweb/go/src/github.com/bketelsen/gaweb/gaweb'
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment