Instantly share code, notes, and snippets.

Embed
What would you like to do?
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