diff --git a/scripts/pyzebra-start.sh b/scripts/pyzebra-start.sh new file mode 100644 index 0000000..4d3433a --- /dev/null +++ b/scripts/pyzebra-start.sh @@ -0,0 +1,4 @@ +source /home/pyzebra/miniconda3/etc/profile.d/conda.sh + +conda activate prod +pyzebra --port=80 --allow-websocket-origin=pyzebra.psi.ch:80 diff --git a/scripts/pyzebra-test-start.sh b/scripts/pyzebra-test-start.sh new file mode 100644 index 0000000..7035d93 --- /dev/null +++ b/scripts/pyzebra-test-start.sh @@ -0,0 +1,4 @@ +source /home/pyzebra/miniconda3/etc/profile.d/conda.sh + +conda activate test +python ~/pyzebra/pyzebra/app/cli.py --allow-websocket-origin=pyzebra.psi.ch:5006 diff --git a/scripts/pyzebra-test.service b/scripts/pyzebra-test.service new file mode 100644 index 0000000..99516f5 --- /dev/null +++ b/scripts/pyzebra-test.service @@ -0,0 +1,11 @@ +[Unit] +Description=pyzebra-test web server (runs on port 5006) + +[Service] +Type=simple +User=pyzebra +ExecStart=/bin/bash /usr/local/sbin/pyzebra-test-start.sh +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/scripts/pyzebra.service b/scripts/pyzebra.service new file mode 100644 index 0000000..0cfd5e9 --- /dev/null +++ b/scripts/pyzebra.service @@ -0,0 +1,10 @@ +[Unit] +Description=pyzebra web server + +[Service] +Type=simple +ExecStart=/bin/bash /usr/local/sbin/pyzebra-start.sh +Restart=always + +[Install] +WantedBy=multi-user.target