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;"