diff --git a/Dockerfile b/Dockerfile index fa35388a..c171bf48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..43bb9926 --- /dev/null +++ b/entrypoint.sh @@ -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 "$@"