Skip to content

Commit

Permalink
added gunicorn hot-reload
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Apr 29, 2024
1 parent 6a36757 commit a8d2691
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions bin/docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,18 @@ workers_healthcheck() {

server() {
# Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details.
case $REDASH_PRODUCTION in
true)
echo "Starting Redash Server in production mode"
MAX_REQUESTS=${MAX_REQUESTS:-1000}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100}
TIMEOUT=${REDASH_GUNICORN_TIMEOUT:-60}
exec /usr/local/bin/gunicorn \
-b 0.0.0.0:5000 \
--name redash \
-w${REDASH_WEB_WORKERS:-4} redash.wsgi:app \
--max-requests $MAX_REQUESTS \
--max-requests-jitter $MAX_REQUESTS_JITTER \
--timeout $TIMEOUT
;;
*)
echo "Starting Redash Server in a dev mode"
export FLASK_DEBUG=1
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
;;
esac
MAX_REQUESTS=${MAX_REQUESTS:-1000}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100}
TIMEOUT=${REDASH_GUNICORN_TIMEOUT:-60}
echo "Starting Redash Server"
exec /usr/local/bin/gunicorn \
-b 0.0.0.0:5000 \
--name redash \
-w${REDASH_WEB_WORKERS:-4} redash.wsgi:app \
--max-requests $MAX_REQUESTS \
--max-requests-jitter $MAX_REQUESTS_JITTER \
--timeout $TIMEOUT \
--reload
}

create_db() {
Expand Down

0 comments on commit a8d2691

Please sign in to comment.