aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2022-07-12 19:29:50 +0200
committerGravatar √Čtienne Deparis 2022-07-12 19:29:50 +0200
commitd6bc766a8d89423bce275b6e8b5d749f3e5a2f6c (patch)
tree8fafab3a2e2ef1a81b520e1331596e54edabfcb7
parenta99060128222cb11ef06fe8ba26b92910ae846fa (diff)
downloadbiberons-d6bc766a8d89423bce275b6e8b5d749f3e5a2f6c.tar.gz
biberons-d6bc766a8d89423bce275b6e8b5d749f3e5a2f6c.tar.xz
biberons-d6bc766a8d89423bce275b6e8b5d749f3e5a2f6c.zip
doc: Add a systemd service file exemple
-rw-r--r--README.org29
1 files changed, 29 insertions, 0 deletions
diff --git a/README.org b/README.org
index f406abb..a8e1b5a 100644
--- a/README.org
+++ b/README.org
@@ -29,6 +29,8 @@ secret string.
* Run
+** Development server
+
You can start a local server by using the following rake task.
#+begin_src shell
@@ -41,6 +43,33 @@ You should also try to build the various assets first:
rake assets:all
#+end_src
+** Production server
+
+You can adapt the following systemd service file:
+
+#+begin_src
+ [Unit]
+ Description=Control Rack Server for Biberons App
+ After=network.target
+
+ [Service]
+ Type=simple
+ User=www-data
+ Group=www-data
+ Environment="PATH=/usr/local/share/rvm/gems/ruby-3.1.2@biberons/bin:/usr/local/share/rvm/gems/ruby-3.1.2@global/bin:/usr/local/share/rvm/rubies/ruby-3.1.2/bin:/usr/local/share/rvm/bin:/usr/local/bin:/usr/bin:/bin"
+ Environment="GEM_HOME=/usr/local/share/rvm/gems/ruby-3.1.2@biberons"
+ Environment="GEM_PATH=/usr/local/share/rvm/gems/ruby-3.1.2@biberons:/usr/local/share/rvm/gems/ruby-3.1.2@global"
+ Environment="BIBERON_SESSION_SECRET=bliblabluverylongstringohmy"
+ Environment="BIBERON_COOKIE_DOMAIN=mywebsite.com"
+ Environment="RACK_ENV=production"
+ WorkingDirectory=/opt/web/biberon
+ ExecStart=/usr/local/share/rvm/gems/ruby-3.1.2@biberons/bin/rackup -I ./lib -s puma -E production -P ./tmp/puma.pid -o 127.0.0.1 -p 9595
+ KillMode=control-group
+
+ [Install]
+ WantedBy=multi-user.target
+#+end_src
+
* Credits
- framework CSS: https://milligram.io/