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 8, 2018
1 parent bec183c commit 0ba6603
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ 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 && \
apt-get install -y -qq libexpat1-dev gcc libssl-dev libffi-dev libjemalloc1 && \
curl https://sh.rustup.rs | sh -s -- -y && \
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 0ba6603

Please sign in to comment.