Mise à jour de 'librephotos.sh'

This commit is contained in:
thomas 2021-03-01 01:57:01 +00:00
parent 4e53ce9a5d
commit 8a08c02f50
1 changed files with 29 additions and 6 deletions

View File

@ -26,9 +26,8 @@ pip3 install torch==1.7.1+cpu torchvision==0.8.2+cpu -f https://download.pytorch
pip3 install -v --install-option="--no" --install-option="DLIB_USE_CUDA" --install-option="--no" --install-option="USE_AVX_INSTRUCTIONS" --install-option="--no" --install-option="USE_SSE4_INSTRUCTIONS" dlib
cd /usr/src
git clone https://github.com/LibrePhotos/librephotos
git clone https://github.com/tomamplius/librephotos
cd librephotos
sed 's/geopy==1.11.0/geopy==2.1.0/' -i requirements.txt
pip3 install -r requirements.txt
python3 -m spacy download en_core_web_sm
@ -51,6 +50,10 @@ cd /usr/src/librephotos/
export PYTHONUNBUFFERED=TRUE
mkdir -p /logs
#! /bin/bash
cd /usr/src/librephotos/
export PYTHONUNBUFFERED=TRUE
mkdir -p /logs
export PYTHONUNBUFFERED=TRUE
export BACKEND_HOST=localhost
export DB_BACKEND=postgresql
@ -73,6 +76,27 @@ export ADMIN_EMAIL=thomas@lgy.fr
export ADMIN_PASSWORD=toto
export MAPBOX_API_KEY=
export DEBUG=0
export BASE_DATA=/var/lib/librephotos/
export BASE_LOGS=/var/log/librephotos/
python3 image_similarity/main.py 2>&1 | tee $BASE_LOGS/gunicorn_image_similarity.log &
python3 manage.py showmigrations | tee $BASE_LOGS/show_migrate.log
python3 manage.py migrate | tee $BASE_LOGS/command_migrate.log
python3 manage.py showmigrations | tee $BASE_LOGS/show_migrate.log
python3 manage.py build_similarity_index 2>&1 | tee $BASE_LOGS/command_build_similarity_index.log
python3 manage.py clear_cache
python3 manage.py createadmin -u $ADMIN_USERNAME $ADMIN_EMAIL 2>&1 | tee $BASE_LOGS/command_createadmin.log
echo "Running backend server..."
python3 manage.py rqworker default 2>&1 | tee $BASE_LOGS/rqworker.log &
if [ "$DEBUG" = 1 ]
then
echo "develompent backend starting"
gunicorn --worker-class=gevent --timeout 36000 --reload --bind localhost:8001 --log-level=info ownphotos.wsgi 2>&1 | tee $BASE_LOGS/gunicorn_django.log
else
echo "production backend starting"
gunicorn --worker-class=gevent --timeout 3600 --bind localhost:8001 --log-level=info ownphotos.wsgi 2>&1 | tee $BASE_LOGS/gunicorn_django.log
fi
python3 image_similarity/main.py 2>&1 | tee /logs/gunicorn_image_similarity.log &
python3 manage.py showmigrations | tee /logs/show_migrate.log
@ -160,18 +184,17 @@ http {
# Django media
location /protected_media {
internal;
alias /protected_media/;
alias /var/lib/librephotos/protected_media/;
}
# Original Photos
location /original {
internal;
alias /data/;
alias /var/lib/librephotos/data/;
}
# Nextcloud Original Photos
location /nextcloud_original {
internal;
alias /data/nextcloud_media/;
alias /var/lib/librephotos/data/nextcloud_media/;
}
}
}