fixed service

This commit is contained in:
arne 2023-08-22 19:16:13 +02:00
parent 188c81b572
commit 5496146053
3 changed files with 19 additions and 13 deletions

8
app.sh
View File

@ -1,8 +0,0 @@
#!/bin/sh
BASE=$(dirname $0)
cd $BASE
git pull
source env/bin/activate
pip3 install -r requirements.txt
gunicorn -D --bind 0.0.0.0:80 --pid /var/run/webapp.pid wsgi:app

13
entrypoint.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
BASE=$(dirname $0)
cd $BASE
git pull
if [ -d env ];
then
python3 -m venv env
fi
source env/bin/activate
pip3 install -U -r requirements.txt
gunicorn -D --bind 0.0.0.0:8080 --pid /run/webapp.pid wsgi:app

View File

@ -1,12 +1,13 @@
#!/sbin/openrc-run
name="busybox $SVCNAME"
command="/opt/webapp/app.sh"
command_args=""
name="scratch-cloudvars-server"
command="/data/entrypoint.sh"
pidfile="/var/run/$SVCNAME.pid"
command_background="yes"
output_logger="/usr/bin/logger"
error_logger="/usr/bin/logger"
depend() {
need net
use dns
use logger
}