Skip to content

Commit fdb714f

Browse files
add new entrypoint script
1 parent 193253f commit fdb714f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
umask 0002
3+
4+
id
5+
6+
set -e # needed to handle "exit" correctly
7+
8+
. /secret-file-loader.sh
9+
. /reach_database.sh
10+
11+
wait_for_database_to_be_reachable
12+
echo
13+
14+
if [ "${DD_CELERY_WORKER_POOL_TYPE}" = "prefork" ]; then
15+
EXTRA_PARAMS=("--autoscale=${DD_CELERY_WORKER_AUTOSCALE_MAX},${DD_CELERY_WORKER_AUTOSCALE_MIN}"
16+
"--prefetch-multiplier=${DD_CELERY_WORKER_PREFETCH_MULTIPLIER}")
17+
else
18+
EXTRA_PARAMS=()
19+
fi
20+
21+
# do the check with Django stack
22+
python3 manage.py check
23+
24+
# hot reload using watmedo as we don't want to install celery[dev] and have that end up in our production images
25+
watchmedo auto-restart --directory=./ --pattern="*.py;*.tpl" --recursive -- \
26+
celery --app=dojo worker --loglevel="${DD_CELERY_LOG_LEVEL}" --pool="${DD_CELERY_WORKER_POOL_TYPE}" --concurrency="${DD_CELERY_WORKER_CONCURRENCY:-1}" "${EXTRA_PARAMS[@]}"

0 commit comments

Comments
 (0)