allow this to work in padev container (e.g. run as mythtv)

This commit is contained in:
2024-06-29 13:49:31 +10:00
parent 4885acea80
commit d53bffcab9

View File

@@ -6,10 +6,7 @@ if [ "$ENV" == "production" ]; then
su mythtv -g mythtv -c 'ENV="production" python3 -u /code/pa_job_manager.py' &> /var/log/pa_job_manager.out & su mythtv -g mythtv -c 'ENV="production" python3 -u /code/pa_job_manager.py' &> /var/log/pa_job_manager.out &
gunicorn --bind=0.0.0.0:80 --workers=4 --threads=16 main:app --env ENV="production" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output gunicorn --bind=0.0.0.0:80 --workers=4 --threads=16 main:app --env ENV="production" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output
elif [ "$ENV" == "container" ]; then elif [ "$ENV" == "container" ]; then
cd /home/ddp/src/photoassistant/ ENV="container" sudo -u mythtv python3 -u pa_job_manager.py &
# add ddp quickly to container so we can run the job manager as ddp and write to the files
echo "ddp:x:1000:1000:Damien De Paoli,,,:/home/ddp:/bin/bash" >> /etc/passwd
ENV="container" sudo -u ddp python3 -u pa_job_manager.py &
gunicorn --bind=0.0.0.0:80 --workers=1 --threads=1 main:app --env ENV="container" --reload --capture-output gunicorn --bind=0.0.0.0:80 --workers=1 --threads=1 main:app --env ENV="container" --reload --capture-output
else else
echo "Not sure which ENV ($ENV) we are running, set up for DEV and dont run job manager (jic)" echo "Not sure which ENV ($ENV) we are running, set up for DEV and dont run job manager (jic)"