From 84bb8fe7737a7172c8cf9068689bc2a82b753020 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Thu, 17 Nov 2016 13:49:24 -0200 Subject: [PATCH] Fixes ruby-build with jemalloc --- image/base/Dockerfile | 5 +++-- templates/web.template.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/image/base/Dockerfile b/image/base/Dockerfile index bfdcd81..34d194e 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -4,6 +4,7 @@ FROM ubuntu:16.04 ENV PG_MAJOR 9.5 ENV PG_VERSION 9.5.5-1.pgdg16.04+1 +ENV CONFIGURE_OPTS --with-jemalloc MAINTAINER Sam Saffron "https://twitter.com/samsaffron" @@ -55,12 +56,12 @@ RUN apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng RUN mkdir /jemalloc && cd /jemalloc &&\ wget https://github.com/jemalloc/jemalloc/releases/download/4.3.1/jemalloc-4.3.1.tar.bz2 &&\ - tar -xjf jemalloc-4.3.1.tar.bz2 && cd jemalloc-4.3.1 && ./configure && make && make install &&\ + tar -xjf jemalloc-4.3.1.tar.bz2 && cd jemalloc-4.3.1 && ./configure --prefix=/usr && make && make install &&\ cd / && rm -rf /jemalloc RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ - cd /src/ruby-build && RUBY_CONFIGURE_OPTS='--with-jemalloc' ./install.sh &&\ + cd /src/ruby-build && ./install.sh &&\ cd / && rm -rf /src/ruby-build && ruby-build 2.3.2 /usr/local RUN gem install bundler &&\ diff --git a/templates/web.template.yml b/templates/web.template.yml index 0f630a2..c95ff59 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -91,7 +91,7 @@ run: # postgres cd $home chown -R discourse:www-data /shared/log/rails - LD_PRELOAD=/usr/local/lib/libjemalloc.so.2 HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb + HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb - file: path: /etc/service/nginx/run -- 2.25.1