Skip to content

Commit

Permalink
Use new entrypoint cmd per guidance from Pulp team
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
rooftopcellist committed Mar 25, 2024
1 parent 6af55dc commit 0a278f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
5 changes: 2 additions & 3 deletions docker/bin/start-api
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ set -o errexit
set -o nounset


readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/usr/local/bin/pulpcore-api'}
readonly GUNICORN_FORWARDED_ALLOW_IPS="${GUNICORN_FORWARDED_ALLOW_IPS:-}"
readonly GUNICORN_WORKERS="${GUNICORN_WORKERS:-4}"
readonly GUNICORN_LOGGER_CLASS="${GUNICORN_LOGGER_CLASS:-}"
readonly GUNICORN_TIMEOUT="${GUNICORN_TIMEOUT:-60}"

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT=${GUNICORN_PORT:-8000}
readonly APP_MODULE='pulpcore.app.wsgi:application'


GUNICORN_OPTIONS=(
Expand All @@ -31,4 +30,4 @@ if [[ -n "${GUNICORN_LOGGER_CLASS}" ]]; then
GUNICORN_OPTIONS+=(--logger-class "${GUNICORN_LOGGER_CLASS}")
fi

exec "${GUNICORN}" "${GUNICORN_OPTIONS[@]}" "${APP_MODULE}"
exec "${ENTRYPOINT}" "${GUNICORN_OPTIONS[@]}"
5 changes: 2 additions & 3 deletions docker/bin/start-api-reload
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ set -o errexit
set -o nounset


readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/usr/local/bin/pulpcore-api'}
readonly GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
readonly GUNICORN_LOGGER_CLASS="${GUNICORN_LOGGER_CLASS:-}"

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT=8000
readonly APP_MODULE='pulpcore.app.wsgi:application'

GUNICORN_OPTIONS=(
--bind "${BIND_HOST}:${BIND_PORT}"
Expand All @@ -27,4 +26,4 @@ if [[ -n "${GUNICORN_LOGGER_CLASS}" ]]; then
GUNICORN_OPTIONS+=(--logger-class "${GUNICORN_LOGGER_CLASS}")
fi

exec "${GUNICORN}" "${GUNICORN_OPTIONS[@]}" "${APP_MODULE}"
exec "${ENTRYPOINT}" "${GUNICORN_OPTIONS[@]}"
10 changes: 3 additions & 7 deletions docker/bin/start-content-app
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
set -o errexit
set -o nounset

readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/usr/local/bin/pulpcore-content'}
readonly GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT="${GUNICORN_PORT:-24816}"
readonly WORKER_CLASS='aiohttp.GunicornWebWorker'
readonly APP_MODULE='pulpcore.content:server'

exec "${GUNICORN}" \
exec "${ENTRYPOINT}" \
--bind "${BIND_HOST}:${BIND_PORT}" \
--worker-class "${WORKER_CLASS}" \
--workers "${GUNICORN_WORKERS}" \
--access-logfile - \
"${APP_MODULE}"
--access-logfile

0 comments on commit 0a278f8

Please sign in to comment.