From e06439e2754fe72847a20e1f6e031391725e94e7 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 26 Jan 2024 20:48:19 -0500 Subject: [PATCH] Use jemalloc for memory allocation --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index af98393..f19c5f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ FROM base # Install packages needed for deployment RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \ + apt-get install --no-install-recommends -y curl libsqlite3-0 libvips libjemalloc2 && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives # Copy built artifacts: gems, application @@ -55,6 +55,8 @@ RUN useradd rails --create-home --shell /bin/bash && \ chown -R rails:rails db log storage tmp USER rails:rails +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + # Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint"]