From fee92bdb95776ae10dcbd661d40cb893f6ed7d1a Mon Sep 17 00:00:00 2001 From: Daniel Al Mouiee Date: Thu, 30 Nov 2023 12:24:35 +1100 Subject: [PATCH] Added deployment folder --- deploy/start_celery.sh | 5 +++++ deploy/start_server.sh | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 deploy/start_celery.sh create mode 100644 deploy/start_server.sh diff --git a/deploy/start_celery.sh b/deploy/start_celery.sh new file mode 100644 index 0000000..a7de861 --- /dev/null +++ b/deploy/start_celery.sh @@ -0,0 +1,5 @@ +#! /usr/bin/env +# start-server.sh +echo "celery starting up" +cd /projects +poetry run celery -A dashboard worker -l info diff --git a/deploy/start_server.sh b/deploy/start_server.sh new file mode 100644 index 0000000..09dcfa1 --- /dev/null +++ b/deploy/start_server.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env +# start-server.sh + +if [ "$DEPLOY_ENV" = "STAGING" ] || [ "$DEPLOY_ENV" = "PRODUCTION" ] +then + echo "Waiting for mysql..." + while ! nc -z db 3306; do + sleep 0.1 + done + echo "MySQL started" +fi + +echo "NGINX starting up dataweb server" +cd /projects +celery -A dataweb beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler & +python manage.py migrate --noinput +python manage.py collectstatic --noinput +python manage.py init_admin +gunicorn dataweb.wsgi --user www-data --bind 0.0.0.0:8010 --workers 3 --timeout 90 & +memcached -u root & +nginx -g "daemon off;"