Skip to content

Instantly share code, notes, and snippets.

@aeris
Created September 30, 2016 19:13
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 aeris/24862f2d0c34e831d80cb616e995957b to your computer and use it in GitHub Desktop.
Save aeris/24862f2d0c34e831d80cb616e995957b to your computer and use it in GitHub Desktop.
Discourse SystemD services
[Unit]
Description=Discourse Sidekiq
Requires=redis-server.service
After=redis-server.service
[Service]
User=www-data
WorkingDirectory=/srv/www/discourse
Environment=RBENV_ROOT=/usr/local/rbenv
Environment=RAILS_ENV=production
Environment=DISCOURSE_DB_HOST=localhost
Environment=DISCOURSE_DB_PASSWORD=un-bon-gros-mot-de-passe
Environment=DISCOURSE_HOSTNAME=le.futur.domaine.de.votre.forum
SyslogIdentifier=discourse-sidekiq
PIDFile=/srv/www/discourse/tmp/pids/sidekiq.pid
ExecStart=/usr/local/rbenv/shims/bundle exec /usr/local/rbenv/shims/sidekiq
[Install]
WantedBy=multi-user.target
[Unit]
Description=Discourse Unicorn
Requires=redis-server.service
Wants=postgresql.service
After=redis-server.service postgresql.service
[Service]
User=www-data
WorkingDirectory=/srv/www/discourse
Environment=RBENV_ROOT=/usr/local/rbenv
Environment=RAILS_ENV=production
Environment=DISCOURSE_DB_HOST=localhost
Environment=DISCOURSE_DB_PASSWORD=un-bon-gros-mot-de-passe
Environment=DISCOURSE_HOSTNAME=le.futur.domaine.de.votre.forum
SyslogIdentifier=discourse-unicorn
PIDFile=/srv/www/discourse/tmp/pids/unicorn.pid
ExecStart=/usr/local/rbenv/shims/bundle exec /usr/local/rbenv/shims/unicorn_rails -p 8081 -E production -D
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment