Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: allow optional use of jemalloc
Browse files Browse the repository at this point in the history
via USE_JEMALLOC which defaults to false

Closes #1100
  • Loading branch information
pjenvey committed Jan 4, 2018
1 parent bec183c commit 3b1c72a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM pypy:2-5.9.0

RUN mkdir -p /app
ADD . /app
RUN chmod +x /app/entrypoint.sh

WORKDIR /app
ENV PATH=$PATH:/root/.cargo/bin

RUN \
apt-get update && \
apt-get install -y -qq libexpat1-dev gcc libssl-dev libffi-dev && \
curl https://sh.rustup.rs | sh -s -- -y && \
apt-get install -y -qq libexpat1-dev gcc libssl-dev libffi-dev libjemalloc1 && \
make clean && \
pip install -r requirements.txt && \
pypy setup.py develop

ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["autopush"]
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ "${USE_JEMALLOC:-false}" = "true" ]; then
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.1"
fi

exec "$@"

0 comments on commit 3b1c72a

Please sign in to comment.