diff --git a/services/swh-deposit/entrypoint.sh b/services/swh-deposit/entrypoint.sh index 78e9204..58e5406 100755 --- a/services/swh-deposit/entrypoint.sh +++ b/services/swh-deposit/entrypoint.sh @@ -1,35 +1,35 @@ #!/bin/bash set -ex source /srv/softwareheritage/utils/pyutils.sh setup_pip source /srv/softwareheritage/utils/pgsql.sh setup_pgsql if [ "$1" = 'shell' ] ; then exec bash -i else wait_pgsql echo "Migrating db" django-admin migrate --settings=swh.deposit.settings.production swh-deposit admin user exists test || \ swh-deposit admin user create \ --username test \ --password test \ --provider-url https://softwareheritage.org \ --domain softwareheritage.org echo "starting swh-deposit server" exec gunicorn --bind 0.0.0.0:5006 \ --reload \ --threads 2 \ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ - swh.deposit.wsgi + 'django.core.wsgi:get_wsgi_application()' fi diff --git a/services/swh-indexer-storage/entrypoint.sh b/services/swh-indexer-storage/entrypoint.sh index 4375401..ec5d92c 100755 --- a/services/swh-indexer-storage/entrypoint.sh +++ b/services/swh-indexer-storage/entrypoint.sh @@ -1,32 +1,32 @@ #!/bin/bash set -e source /srv/softwareheritage/utils/pyutils.sh setup_pip source /srv/softwareheritage/utils/pgsql.sh setup_pgsql case "$1" in "shell") exec bash -i ;; *) wait_pgsql echo Setup the database PGPASSWORD=${POSTGRES_PASSWORD} swh db-init \ --db-name ${POSTGRES_DB} indexer echo Starting the swh-indexer-storage API server exec gunicorn --bind 0.0.0.0:5007 \ --reload \ --threads 2 \ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ - swh.indexer.storage.api.wsgi + 'swh.indexer.storage.api.server:make_app_from_configfile()' ;; esac diff --git a/services/swh-objstorage/entrypoint.sh b/services/swh-objstorage/entrypoint.sh index 12161f8..30fcefc 100755 --- a/services/swh-objstorage/entrypoint.sh +++ b/services/swh-objstorage/entrypoint.sh @@ -1,24 +1,24 @@ #!/bin/bash set -e source /srv/softwareheritage/utils/pyutils.sh setup_pip echo Installed Python packages: pip list if [ "$1" = 'shell' ] ; then exec bash -i else echo Starting the swh-objstorage API server exec gunicorn --bind 0.0.0.0:5003 \ --worker-class aiohttp.worker.GunicornWebWorker \ --log-level DEBUG \ --threads 4 \ --workers 2 \ --reload \ --timeout 3600 \ - swh.objstorage.api.wsgi + 'swh.objstorage.api.server:make_app_from_configfile()' fi diff --git a/services/swh-storage/entrypoint.sh b/services/swh-storage/entrypoint.sh index a7ee3ef..359880c 100755 --- a/services/swh-storage/entrypoint.sh +++ b/services/swh-storage/entrypoint.sh @@ -1,45 +1,45 @@ #!/bin/bash set -e source /srv/softwareheritage/utils/pyutils.sh setup_pip if [ "$STORAGE_BACKEND" = "postgresql" ]; then source /srv/softwareheritage/utils/pgsql.sh setup_pgsql elif [ "$STORAGE_BACKEND" = "cassandra" ]; then echo Waiting for Cassandra to start wait-for-it ${CASSANDRA_SEED}:9042 -s --timeout=0 echo Creating keyspace cat << EOF | python3 from swh.storage.cassandra import create_keyspace create_keyspace(['cassandra-seed'], 'swh') EOF fi case "$1" in "shell") exec bash -i ;; *) if [ "$STORAGE_BACKEND" = "postgresql" ]; then wait_pgsql echo Setup the database PGPASSWORD=${POSTGRES_PASSWORD} swh db-init \ --db-name ${POSTGRES_DB} storage fi echo Starting the swh-storage API server exec gunicorn --bind 0.0.0.0:5002 \ --reload \ --threads 4 \ --workers 2 \ --log-level DEBUG \ --timeout 3600 \ - swh.storage.api.wsgi + 'swh.storage.api.server:make_app_from_configfile()' ;; esac diff --git a/services/swh-web/entrypoint.sh b/services/swh-web/entrypoint.sh index 8a4961a..d33a904 100755 --- a/services/swh-web/entrypoint.sh +++ b/services/swh-web/entrypoint.sh @@ -1,38 +1,38 @@ #!/bin/bash set -e create_admin_script=" from django.contrib.auth import get_user_model; username = 'admin'; password = 'admin'; email = 'admin@swh-web.org'; User = get_user_model(); if not User.objects.filter(username = username).exists(): User.objects.create_superuser(username, email, password); " source /srv/softwareheritage/utils/pyutils.sh setup_pip case "$1" in "shell") exec bash -i ;; *) echo "Migrating db using ${DJANGO_SETTINGS_MODULE}" django-admin migrate --settings=${DJANGO_SETTINGS_MODULE} echo "Creating admin user" echo "$create_admin_script" | python3 -m swh.web.manage shell echo "starting the swh-web server" exec gunicorn --bind 0.0.0.0:5004 \ --threads 2 \ --workers 2 \ --timeout 3600 \ - swh.web.wsgi + 'django.core.wsgi:get_wsgi_application()' esac