diff --git a/docs/process-management.md b/docs/process-management.md index 7c24bf402..17e541b69 100644 --- a/docs/process-management.md +++ b/docs/process-management.md @@ -18,7 +18,7 @@ ps:stop Stop app container(s) ## Scaling -Dokku allows you to run multiple process types at different container counts. For example, if you had an app that contained 1 web app listener and 1 background job processor, dokku will, by default, spin up 1 container for each process type defined in the Procfile. If you wanted 2 job processors running simultaneously, you can modify this behavior in a few ways. +Dokku allows you to run multiple process types at different container counts. For example, if you had an app that contained 1 web app listener and 1 background job processor, dokku can, spin up 1 container for each process type defined in the Procfile. By default we will only start the web process. However, if you wanted 2 job processors running simultaneously, you can modify this behavior in a few ways. ## Include a DOKKU_SCALE file in your repo diff --git a/plugins/ps/functions b/plugins/ps/functions index e17233023..e92632564 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -25,38 +25,10 @@ release_and_deploy() { generate_scale_file() { local APP="$1"; local IMAGE="dokku/$APP"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" - copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || dokku_log_info1_quiet "DOKKU_SCALE not found in app image" + copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true if [[ ! -f $DOKKU_SCALE_FILE ]]; then - local TMP_WORK_DIR=$(mktemp --tmpdir=/tmp -d DOKKU_SCALE.XXXXX) - trap 'rm -rf $TMP_WORK_DIR' INT TERM EXIT RETURN - - - if is_image_buildstep_based "$IMAGE"; then - copy_from_image "$IMAGE" /app/Procfile $TMP_WORK_DIR 2>/dev/null || true - copy_from_image "$IMAGE" /app/.release $TMP_WORK_DIR 2>/dev/null || true - - if [[ -f $TMP_WORK_DIR/Procfile ]];then - local PROCFILE="$TMP_WORK_DIR/Procfile" - elif [[ -f $TMP_WORK_DIR/.release ]];then - local PROCFILE="$TMP_WORK_DIR/.release" - else - dokku_log_info1 "No Procfile or .release file found. Defaulting to a single web process" - echo "web=1" >> $DOKKU_SCALE_FILE - fi - else - dokku_log_info1 "Dockerfile build detected. Defaulting to a single web process" - echo "web=1" >> $DOKKU_SCALE_FILE - fi - - if [[ -f $PROCFILE ]]; then - while read line || [ -n "$line" ] - do - local PROC_NAME=${line%%:*} - local PROC_CMD=${line#*:} - [[ "$PROC_NAME" =~ -.* ]] && continue - [[ -n "$PROC_CMD" ]] && echo "$PROC_NAME=1" >> $DOKKU_SCALE_FILE - done < "$PROCFILE" - fi + dokku_log_info1_quiet "DOKKU_SCALE not found in app image. Defaulting to a single web process" + echo "web=1" >> $DOKKU_SCALE_FILE dokku_log_info1_quiet "New DOKKU_SCALE file generated" while read line || [ -n "$line" ]