-
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
Conversation
Signed-off-by: Tobias Gurtzick <[email protected]>
/cc @carrodher |
@migruiz4, as you have more context than me with this PR and it looks like you have already started checking the changes in the associated issue, I'm handling it over to you so you can take the best decision. |
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.
Hi @wzrdtales,
Please take a look at my comments below.
I have suggested several changes, including the removal of runit
as it does not seem necessary to run unicorn.
DISCOURSE_SERVE_STATIC_ASSETS="${DISCOURSE_SERVE_STATIC_ASSETS:-true}" | ||
export DISCOURSE_SERVE_STATIC_ASSETS="${DISCOURSE_SERVE_STATIC_ASSETS:-true}" |
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.
Please move these lines under the # Discourse configuration
comment
@@ -17,7 +17,7 @@ RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "node" "14.20.0-1 | |||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "git" "2.37.1-1" --checksum 39ea3040baa552b4760c1100a3713f86493620c0a74121c1ceba50fe17341878 | |||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "brotli" "1.0.9-151" --checksum ba4c4d26d232f8d91d1143078a633ba7c5ae33f5c4182684400ffb7bbc0ed262 | |||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "discourse" "2.8.7-1" --checksum bd120eab1a7403e691f608f57b574a9782391fe1c4a46ce40752cfa560f922c2 | |||
RUN apt-get update && apt-get upgrade -y && \ | |||
RUN apt-get update && apt-get upgrade -y && apt-get install sudo runit -y && \ |
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
"-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 comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename PASSENGER
env variables.
@@ -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}" | |||
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 comment
The 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.
export DISCOURSE_PORT_NUMBER="${DISCOURSE_PORT_NUMBER:-8080}"
In addition, please replace the ports
value at docker-compose.yaml
.
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use chpst
if runit won't be used
chpst -u "$DISCOURSE_DAEMON_USER" -U "$DISCOURSE_DAEMON_USER" "bundle" "exec" "config/unicorn_launcher" | |
"bundle" "exec" "config/unicorn_launcher" |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid running the process as root, use the following instead:
USER=$DISCOURSE_DAEMON_USER exec "${cmd[@]}" "$@" | |
if am_i_root; then | |
exec gosu "$DISCOURSE_DAEMON_USER" "${cmd[@]}" | |
else | |
exec "${cmd[@]}" | |
fi |
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary. |
this stuff is unmaintained. If I were you I would look elsewhere. |
yeah, we're maintaining it until today ourselves in a forked image... . |
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
@migruiz4 |
Hi @jacobowitz, We have an internal task to study if migrating As I mentioned in my review, the usage of |
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary. |
Original https://github.com/bitnami/bitnami-docker-discourse/pull/234
discourse lately removed the setting from the UI, this image doesn't really work properly without disabling this option currently.
Signed-off-by: Tobias Gurtzick [email protected]
right now requires to set serve_static_assets = true
important info from previous ticket:
the docker-compose seems to be outdated and deviates from the helm chart.
The helm chart sets already
These two variables, and adding those to the docker-compose lets it run just fine.