Skip to content

Commit a1324b5

Browse files
committed
Install jemalloc via apt package and configure ruby to use transparently
See docker-library/ruby#182 for more details.
1 parent 90d90cd commit a1324b5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ LABEL maintainer Travis CI GmbH <[email protected]>
55
# packages required for bundle install
66
RUN ( \
77
apt-get update ; \
8-
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev \
8+
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev libjemalloc-dev \
99
&& rm -rf /var/lib/apt/lists/* \
1010
)
1111

12+
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
13+
1214
# throw errors if Gemfile has been modified since Gemfile.lock
1315
RUN bundle config --global frozen 1
1416
RUN bundle config set deployment 'true'

Procfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
web: ./script/server-buildpacks
2-
console: jemalloc.sh bundle exec ./script/console
3-
cron: jemalloc.sh bundle exec ./bin/cron
2+
console: bundle exec ./script/console
3+
cron: bundle exec ./bin/cron

script/server

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ cmd="unicorn config.ru -E $RACK_ENV -c config/unicorn.rb"
2525
[[ $RACK_ENV == "development" ]] && cmd="rerun -b -- $cmd"
2626

2727
if [ -z "$DYNO" ]; then
28-
cmd="jemalloc.sh bundle exec $cmd"
28+
cmd="bundle exec $cmd"
2929
else
30-
cmd="jemalloc.sh bin/start-nginx $cmd"
30+
cmd="bin/start-nginx $cmd"
3131
fi
3232

3333
exec $cmd

0 commit comments

Comments
 (0)