From 07dc04eaba6c4950468deccc3f9732e6f2a13132 Mon Sep 17 00:00:00 2001 From: Matt Critchlow Date: Thu, 24 Aug 2023 07:01:44 -0700 Subject: [PATCH 1/2] Update Dockerfile to use Ruby 3.22, Alpine 3.18 This also affords dropping the manual installation of jemalloc, as in Alpine 3.18 the desired version is in the package repository. https://pkgs.alpinelinux.org/package/v3.18/main/x86_64/jemalloc --- Dockerfile | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 19ce618e4c..92b05de5df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ -ARG RUBY_VERSION=3.2.1 +ARG ALPINE_VERSION=3.18 +ARG RUBY_VERSION=3.2.2 -# Replace with official jemalloc package in alpine 3.17 -FROM ruby:$RUBY_VERSION-alpine3.16 as builder -RUN apk add build-base curl -RUN curl -sL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \ - cd jemalloc-5.3.0 && \ - ./configure && \ - make && \ - make install +FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as builder +RUN apk add build-base curl jemalloc -FROM ruby:$RUBY_VERSION-alpine3.16 as hyrax-base +FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base ARG DATABASE_APK_PACKAGE="postgresql-dev" ARG EXTRA_APK_PACKAGES="git" @@ -43,7 +38,7 @@ ENV PATH="/app/samvera:$PATH" ENV RAILS_ROOT="/app/samvera/hyrax-webapp" ENV RAILS_SERVE_STATIC_FILES="1" -COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/ +COPY --from=builder /usr/lib/libjemalloc.so.2 /usr/local/lib/ ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" ENTRYPOINT ["hyrax-entrypoint.sh"] From 1a1042e4616149d16fde21e3a1b4e207414f8587 Mon Sep 17 00:00:00 2001 From: Matt Critchlow Date: Thu, 24 Aug 2023 07:03:05 -0700 Subject: [PATCH 2/2] docker-compose: set solr ulimits This fixes a known issues on some devices where the solr container can take minutes to start. Already applied on nurax[1]. 1. https://github.com/samvera-labs/nurax/blob/pg/docker-compose.yml#L113-L116 --- docker-compose-koppie.yml | 4 ++++ docker-compose.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docker-compose-koppie.yml b/docker-compose-koppie.yml index 01ce8becb9..194775b3ab 100644 --- a/docker-compose-koppie.yml +++ b/docker-compose-koppie.yml @@ -142,6 +142,10 @@ services: volumes: - solr_home:/var/solr/data:cached - .koppie/solr/conf:/opt/solr/server/configsets/hyraxconf + ulimits: + nofile: + soft: 65536 + hard: 524288 networks: - koppie diff --git a/docker-compose.yml b/docker-compose.yml index 8298ab31fa..318bcbd740 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -147,6 +147,10 @@ services: volumes: - solr_home:/var/solr/data:cached - .dassie/solr/conf:/opt/solr/server/configsets/hyraxconf + ulimits: + nofile: + soft: 65536 + hard: 524288 networks: - hyrax