-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/discourse] Use unicorn instead of passenger #2355
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" | |
# By setting an environment variable matching *_FILE to a file path, the prefixed environment | ||
# variable will be overridden with the value specified in that file | ||
discourse_env_vars=( | ||
DISCOURSE_SERVE_STATIC_ASSETS | ||
DISCOURSE_DATA_TO_PERSIST | ||
DISCOURSE_ENABLE_HTTPS | ||
DISCOURSE_EXTERNAL_HTTP_PORT_NUMBER | ||
|
@@ -92,6 +93,8 @@ export DISCOURSE_CONF_FILE="${DISCOURSE_BASE_DIR}/config/discourse.conf" | |
export PATH="${BITNAMI_ROOT_DIR}/common/bin:${BITNAMI_ROOT_DIR}/brotli/bin:${BITNAMI_ROOT_DIR}/git/bin:${PATH}" | ||
|
||
# Discourse persistence configuration | ||
DISCOURSE_SERVE_STATIC_ASSETS="${DISCOURSE_SERVE_STATIC_ASSETS:-true}" | ||
export DISCOURSE_SERVE_STATIC_ASSETS="${DISCOURSE_SERVE_STATIC_ASSETS:-true}" | ||
Comment on lines
+96
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move these lines under the |
||
export DISCOURSE_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/discourse" | ||
export DISCOURSE_DATA_TO_PERSIST="${DISCOURSE_DATA_TO_PERSIST:-plugins public/backups public/uploads}" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unicorn will fail to start if we use the current default value for DISCOURSE_PORT_NUMBER, please change the value from 3000 to 8080.
In addition, please replace the |
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,11 +18,10 @@ set -o pipefail | |||||||||||||
cd "$DISCOURSE_BASE_DIR" | ||||||||||||||
|
||||||||||||||
declare -a cmd=( | ||||||||||||||
"bundle" "exec" "passenger" "start" | ||||||||||||||
"--user" "$DISCOURSE_DAEMON_USER" | ||||||||||||||
"-e" "$DISCOURSE_ENV" | ||||||||||||||
chpst -u "$DISCOURSE_DAEMON_USER" -U "$DISCOURSE_DAEMON_USER" "bundle" "exec" "config/unicorn_launcher" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to use
Suggested change
|
||||||||||||||
"-E" "$DISCOURSE_ENV" | ||||||||||||||
"-p" "$DISCOURSE_PORT_NUMBER" | ||||||||||||||
"--spawn-method" "$DISCOURSE_PASSENGER_SPAWN_METHOD" | ||||||||||||||
"-c" "config/unicorn.conf.rb" | ||||||||||||||
) | ||||||||||||||
|
||||||||||||||
# Append extra flags specified via environment variables | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename |
||||||||||||||
|
@@ -33,4 +32,4 @@ if [[ -n "$DISCOURSE_PASSENGER_EXTRA_FLAGS" ]]; then | |||||||||||||
fi | ||||||||||||||
|
||||||||||||||
info "** Starting Discourse **" | ||||||||||||||
exec "${cmd[@]}" "$@" | ||||||||||||||
USER=$DISCOURSE_DAEMON_USER exec "${cmd[@]}" "$@" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To avoid running the process as root, use the following instead:
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not installing
runit
in a container unless it is strictly necessary.I have performed some tests using the changes suggested in this review and I was able to use
unicorn
without runit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you change something that supposedly is working, then it would be nice if you just attach it. I don't have time to test a foreign theory. When we tested it didn't work without runit to run as non-root