Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
Update entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Jul 21, 2023
1 parent a377eda commit fe5e698
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions resources/bin/librephotos-backend
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
cd /usr/lib/librephotos/backend

if [[ "$(uname -m)" == "aarch64"* ]]; then
export OPENBLAS_CORETYPE=ARMV8
echo "ARM architecture detected. OPENBLAS_CORETYPE set to ARMV8"
fi
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_MAIN_FREE=1

if [ -n "$SECRET_KEY" ]
then
echo "Use env SECRET_KEY"
Expand All @@ -18,11 +25,15 @@ else
fi
fi

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 | tee $BASE_LOGS/clear_cache.log
python manage.py showmigrations | tee /logs/show_migrate.log
python manage.py migrate | tee /logs/command_migrate.log
python manage.py showmigrations | tee /logs/show_migrate.log
python manage.py collectstatic --no-input
python image_similarity/main.py 2>&1 | tee /logs/gunicorn_image_similarity.log &
python service/thumbnail/main.py 2>&1 | tee /logs/gunicorn_thumbnail.log &
python manage.py clear_cache
python manage.py build_similarity_index 2>&1 | tee /logs/command_build_similarity_index.log
python manage.py qcluster 2>&1 | tee /logs/qcluster.log &

echo "production backend starting"
gunicorn --workers=2 --worker-class=gevent --timeout 3600 --bind 127.0.0.1:8001 --log-level=info ownphotos.wsgi 2>&1 | tee $BASE_LOGS/gunicorn_django.log
Expand Down

0 comments on commit fe5e698

Please sign in to comment.