Delete entrypoint.sh
Browse files- entrypoint.sh +0 -46
entrypoint.sh
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
|
3 |
-
set -e
|
4 |
-
|
5 |
-
cd /app/api
|
6 |
-
|
7 |
-
if [[ "${MIGRATION_ENABLED}" == "true" ]]; then
|
8 |
-
echo "Running migrations"
|
9 |
-
poetry run flask db upgrade
|
10 |
-
fi
|
11 |
-
|
12 |
-
if [[ "${MODE}" == "worker" ]]; then
|
13 |
-
# Get the number of available CPU cores
|
14 |
-
if [ "${CELERY_AUTO_SCALE,,}" = "true" ]; then
|
15 |
-
AVAILABLE_CORES=$(nproc)
|
16 |
-
MAX_WORKERS=${CELERY_MAX_WORKERS:-$AVAILABLE_CORES}
|
17 |
-
MIN_WORKERS=${CELERY_MIN_WORKERS:-1}
|
18 |
-
CONCURRENCY_OPTION="--autoscale=${MAX_WORKERS},${MIN_WORKERS}"
|
19 |
-
else
|
20 |
-
CONCURRENCY_OPTION="-c ${CELERY_WORKER_AMOUNT:-1}"
|
21 |
-
fi
|
22 |
-
|
23 |
-
exec poetry run celery -A app.celery worker \
|
24 |
-
-P ${CELERY_WORKER_CLASS:-gevent} \
|
25 |
-
$CONCURRENCY_OPTION \
|
26 |
-
--loglevel ${LOG_LEVEL} \
|
27 |
-
-Q ${CELERY_QUEUES:-dataset,mail,ops_trace,app_deletion}
|
28 |
-
|
29 |
-
elif [[ "${MODE}" == "beat" ]]; then
|
30 |
-
exec poetry run celery -A app.celery beat --loglevel ${LOG_LEVEL}
|
31 |
-
else
|
32 |
-
if [[ "${DEBUG}" == "true" ]]; then
|
33 |
-
exec poetry run flask run \
|
34 |
-
--host=${DIFY_BIND_ADDRESS:-0.0.0.0} \
|
35 |
-
--port=7860 \
|
36 |
-
--debug
|
37 |
-
else
|
38 |
-
exec poetry run gunicorn \
|
39 |
-
--bind "0.0.0.0:7860" \
|
40 |
-
--workers ${SERVER_WORKER_AMOUNT:-1} \
|
41 |
-
--worker-class ${SERVER_WORKER_CLASS:-gevent} \
|
42 |
-
--timeout ${GUNICORN_TIMEOUT:-200} \
|
43 |
-
--preload \
|
44 |
-
app:app
|
45 |
-
fi
|
46 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|