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 &&\
- mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc
+ tar -xjf jemalloc-4.3.1.tar.bz2 && cd jemalloc-4.3.1 && ./configure && 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 && ./install.sh &&\
+ cd /src/ruby-build && RUBY_CONFIGURE_OPTS='--with-jemalloc' ./install.sh &&\
cd / && rm -rf /src/ruby-build && ruby-build 2.3.2 /usr/local
RUN gem install bundler &&\
# postgres
cd $home
chown -R discourse:www-data /shared/log/rails
- LD_PRELOAD=/usr/lib/libjemalloc.so.1 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
+ 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
- file:
path: /etc/service/nginx/run