From 43dc3f704d04a5513307581fbe4020f24e6e78c4 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <nuwan.ag@gmail.com> Date: Tue, 16 Oct 2018 19:30:27 +0530 Subject: [PATCH] Switched docker to debian and preinstalled conda --- Dockerfile | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f854e20..cf9ba3dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,31 @@ -FROM python:2.7-alpine +FROM debian:latest ENV PYTHONUNBUFFERED 1 ENV DEBIAN_FRONTEND noninteractive ADD ./requirements.txt /pulsar/ -RUN apk update \ - # psycopg2 dependencies - && apk add --no-cache --virtual build-deps gcc python-dev musl-dev \ - # CFFI dependencies - && apk --no-cache add libffi-dev py-cffi \ - && apk --no-cache add make linux-headers \ +RUN apt-get update \ + # build dependencies + && apt-get install -y --no-install-recommends apt-utils build-essential python-setuptools python-dev python-pip \ \ - # Install python requirements + # preinstall conda for faster startup + && apt-get -y install curl bzip2 \ + && curl -sSL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh \ + && bash /tmp/miniconda.sh -bfp /pulsar/dependencies/_conda \ + && rm -rf /tmp/miniconda.sh \ + \ + # Install pulsar python requirements && pip install --no-cache-dir -r /pulsar/requirements.txt \ \ - # Remove build deps - && apk del build-deps \ - && rm /var/cache/apk/* + # Remove build deps and cleanup + && apt-get -y remove curl bzip2 \ + && apt-get -y autoremove \ + && apt-get autoclean \ + && rm -rf /var/lib/apt/lists/* /var/log/dpkg.log # Create pulsar user environment -RUN adduser -D -g '' pulsar \ +RUN adduser --disabled-password --gecos '' pulsar \ && mkdir -p /pulsar # Set working directory to /pulsar/ @@ -41,4 +46,4 @@ USER pulsar # gunicorn will listen on this port EXPOSE 8913 -CMD sh /usr/local/bin/pulsar \ No newline at end of file +CMD /usr/local/bin/pulsar -- GitLab