From 3dbb74c4b0b2d236d17ebc20c0c2c3d1d79f028c Mon Sep 17 00:00:00 2001 From: Manu Date: Tue, 6 Jan 2026 17:59:05 +0000 Subject: [PATCH] Update to Discourse 3.5.3 with nfrastack base image - Update base image from tiredofit/nginx to nfrastack/nginx:debian_trixie - Update Discourse version to v3.5.3 - Migrate service scripts to /container/run/available/ for nfrastack compatibility - Move defaults and functions to /container/ directory structure - Fix exec placement in service scripts (exec is shell builtin, not command) - Remove deprecated --logfile option from Sidekiq (removed in v7) - Remove uglifier configuration (not needed in Rails 8) - Add netcat-openbsd for redis connectivity check - Update IMAGE_NAME and IMAGE_REPO_URL to nfrastack --- Dockerfile | 24 +++++++++---------- .../defaults/20-discourse | 0 .../functions/20-discourse | 0 .../run/available}/20-discourse/run | 7 +++--- .../run/available}/30-sidekiq/run | 12 +++++----- install/etc/cont-init.d/20-discourse | 3 ++- 6 files changed, 23 insertions(+), 23 deletions(-) rename install/{assets => container}/defaults/20-discourse (100%) rename install/{assets => container}/functions/20-discourse (100%) rename install/{etc/services.available => container/run/available}/20-discourse/run (79%) rename install/{etc/services.available => container/run/available}/30-sidekiq/run (58%) diff --git a/Dockerfile b/Dockerfile index 6e3c7cf..d8b0a5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ ARG DISTRO="debian" -ARG DISTRO_VARIANT="bookworm" +ARG DISTRO_VARIANT="trixie" -FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT} +FROM docker.io/nfrastack/nginx:${DISTRO}_${DISTRO_VARIANT} LABEL maintainer="Dave Conroy (github.com/tiredofit)" ARG DISCOURSE_VERSION ARG RUBY_VERSION ### Environment Variables -ENV DISCOURSE_VERSION=${DISCOURSE_VERSION:-"v3.5.0"} \ +ENV DISCOURSE_VERSION=${DISCOURSE_VERSION:-"v3.5.3"} \ RUBY_VERSION=${RUBY_VERSION:-"3.3.9"} \ RUBY_ALLOCATOR=/usr/lib/libjemalloc.so.2 \ RAILS_ENV=production \ @@ -21,11 +21,11 @@ ENV DISCOURSE_VERSION=${DISCOURSE_VERSION:-"v3.5.0"} \ NGINX_MODE=PROXY \ NGINX_PROXY_URL=http://127.0.0.1:3000 \ NGINX_ENABLE_CREATE_SAMPLE_HTML=FALSE \ - IMAGE_NAME="tiredofit/discourse" \ - IMAGE_REPO_URL="https://github.com/tiredofit/docker-discourse/" + IMAGE_NAME="nfrastack/discourse" \ + IMAGE_REPO_URL="https://github.com/nfrastack/container-discourse/" ### Install Dependencies -RUN source /assets/functions/00-container && \ +RUN source /container/base/functions/container/init && \ BUILD_DEPS=" \ build-essential \ g++ \ @@ -50,10 +50,9 @@ RUN source /assets/functions/00-container && \ set -x && \ addgroup --gid 9009 --system discourse && \ adduser --uid 9009 --gid 9009 --home /dev/null --gecos "Discourse" --shell /sbin/nologin --disabled-password discourse && \ - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ - echo "deb https://deb.nodesource.com/node_22.x nodistro main" > /etc/apt/sources.list.d/nodejs.list && \ - curl -ssL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - echo "deb http://apt.postgresql.org/pub/repos/apt/ $(cat /etc/os-release |grep "VERSION=" | awk 'NR>1{print $1}' RS='(' FS=')')-pgdg main" > /etc/apt/sources.list.d/postgres.list && \ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ $(cat /etc/os-release |grep "VERSION=" | awk 'NR>1{print $1}' RS='(' FS=')')-pgdg main" > /etc/apt/sources.list.d/postgres.list && \ package update && \ package upgrade -y && \ package install \ @@ -67,12 +66,13 @@ RUN source /assets/functions/00-container && \ imagemagick \ jhead \ jpegoptim \ - libicu72 \ + libicu76 \ libjemalloc2 \ libjpeg-turbo-progs \ libpq5 \ libssl3 \ libxml2 \ + netcat-openbsd \ nodejs \ npm \ optipng \ @@ -127,8 +127,6 @@ RUN source /assets/functions/00-container && \ find /app/vendor/bundle -name tmp -type d -exec rm -rf {} + && \ curl -sSL https://git.io/GeoLite2-ASN.mmdb -o /app/vendor/data/GeoLite2-ASN.mmdb && \ curl -sSL https://git.io/GeoLite2-City.mmdb -o /app/vendor/data/GeoLite2-City.mmdb && \ - sed -i "5i\ \ require 'uglifier'" /app/config/environments/production.rb && \ - sed -i "s|config.assets.js_compressor = :uglifier|config.assets.js_compressor = Uglifier.new(harmony: true)|g" /app/config/environments/production.rb && \ ln -sf "$(which convert)" "/usr/bin/magick" && \ \ mkdir -p /assets/discourse/plugins && \ diff --git a/install/assets/defaults/20-discourse b/install/container/defaults/20-discourse similarity index 100% rename from install/assets/defaults/20-discourse rename to install/container/defaults/20-discourse diff --git a/install/assets/functions/20-discourse b/install/container/functions/20-discourse similarity index 100% rename from install/assets/functions/20-discourse rename to install/container/functions/20-discourse diff --git a/install/etc/services.available/20-discourse/run b/install/container/run/available/20-discourse/run similarity index 79% rename from install/etc/services.available/20-discourse/run rename to install/container/run/available/20-discourse/run index a9588cd..9ce9786 100755 --- a/install/etc/services.available/20-discourse/run +++ b/install/container/run/available/20-discourse/run @@ -1,6 +1,7 @@ #!/command/with-contenv bash -source /assets/functions/00-container +source /container/base/functions/container/init +source /container/functions/20-discourse prepare_service PROCESS_NAME="rails" @@ -13,8 +14,8 @@ export UNICORN_WORKERS=${UNICORN_WORKERS} cd /app/ print_start "Starting Unicorn - Discourse version ${DISCOURSE_VERSION}" -s6-setuidgid discourse \ - exec bin/unicorn \ +exec s6-setuidgid discourse \ + bin/unicorn \ -E production \ -o 0.0.0.0 \ -p "${LISTEN_PORT}" \ diff --git a/install/etc/services.available/30-sidekiq/run b/install/container/run/available/30-sidekiq/run similarity index 58% rename from install/etc/services.available/30-sidekiq/run rename to install/container/run/available/30-sidekiq/run index edee83d..2e40f5d 100755 --- a/install/etc/services.available/30-sidekiq/run +++ b/install/container/run/available/30-sidekiq/run @@ -1,7 +1,8 @@ #!/command/with-contenv bash -source /assets/functions/00-container -source /assets/defaults/20-discourse +source /container/base/functions/container/init +source /container/defaults/20-discourse +source /container/functions/20-discourse prepare_service PROCESS_NAME="sidekiq" @@ -11,9 +12,8 @@ liftoff print_start "Starting Sidekiq" cd /app/ -silent sudo -Eu discourse \ - exec bundle exec sidekiq \ +exec sudo -Eu discourse \ + bundle exec sidekiq \ --concurrency ${SIDEKIQ_THREADS} \ --environment production \ - --logfile "${LOG_PATH}"/"${SIDEKIQ_LOG_FILE}" \ - ${SIDEKIQ_ADDITIONAL_ARGS} >> "${LOG_PATH}"/"${SIDEKIQ_LOG_FILE}" + ${SIDEKIQ_ADDITIONAL_ARGS} >> "${LOG_PATH}"/"${SIDEKIQ_LOG_FILE}" 2>&1 diff --git a/install/etc/cont-init.d/20-discourse b/install/etc/cont-init.d/20-discourse index bfb74e2..f75e6b4 100755 --- a/install/etc/cont-init.d/20-discourse +++ b/install/etc/cont-init.d/20-discourse @@ -1,6 +1,7 @@ #!/command/with-contenv bash -source /assets/functions/00-container +source /container/base/functions/container/init +source /container/functions/20-discourse prepare_service PROCESS_NAME="discourse"