mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
added run script
venv install
This commit is contained in:
parent
bb7c8b206a
commit
99323cacf4
5 changed files with 23 additions and 6 deletions
12
conf/dockerless-run.sh
Normal file
12
conf/dockerless-run.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# stop if one process fails
|
||||
set -e
|
||||
|
||||
# bookwyrm
|
||||
__FINALPATH__/venv/bin/gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:__PORT__ &
|
||||
|
||||
# celery
|
||||
__FINALPATH__/venv/bin/celery -A celerywyrm worker -l info -Q high_priority,medium_priority,low_priority &
|
||||
__FINALPATH__/venv/bin/celery -A celerywyrm beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler &
|
||||
# __FINALPATH__/venv/bin/celery -A celerywyrm flower &
|
|
@ -7,9 +7,7 @@ Type=simple
|
|||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=__FINALPATH__/dockerless-run.sh
|
||||
StandardOutput=append:/var/log/__APP__/__APP__.log
|
||||
StandardError=inherit
|
||||
ExecStart=/bin/bash __FINALPATH__/dockerless-run.sh
|
||||
|
||||
# Sandboxing options to harden security
|
||||
# Depending on specificities of your service/app, you may need to tweak these
|
||||
|
|
|
@ -109,6 +109,13 @@ chmod 750 "$final_path"
|
|||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
ynh_add_config --template="dockerless-run.sh" --destination="$final_path/dockerless-run.sh"
|
||||
chmod 700 "$final_path/dockerless-run.sh"
|
||||
chown $app:$app "$final_path/dockerless-run.sh"
|
||||
|
||||
mkdir "$final_path/venv"
|
||||
python3 -m venv "$final_path/venv"
|
||||
$final_path/venv/bin/pip3 install -r "$final_path/requirements.txt"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -155,7 +162,7 @@ ynh_add_systemd_config
|
|||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log"
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -132,7 +132,7 @@ systemctl enable $app.service --quiet
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -163,7 +163,7 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="BookWyrm service" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
Loading…
Add table
Reference in a new issue