diff --git a/serve-python/Dockerfile b/serve-python/Dockerfile index 48992a5..27d1875 100644 --- a/serve-python/Dockerfile +++ b/serve-python/Dockerfile @@ -12,21 +12,22 @@ RUN useradd -m -u 1000 $USER # Set working directory (this is where the code should go) WORKDIR $HOME -RUN apt update \ - && apt install python3.7-dev -y \ - && apt install curl -y \ - && apt-get install python3-distutils -y \ +RUN apt-get update \ + && apt-get install ca-certificates -y --no-install-recommends \ + && apt-get install python3.7-dev -y --no-install-recommends \ + && apt-get install curl -y --no-install-recommends \ + && apt-get install python3-distutils -y --no-install-recommends \ && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && python3.7 get-pip.py \ - && apt install gcc -y \ + && apt-get install gcc -y --no-install-recommends \ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 \ - && pip3 install --upgrade pip \ + && pip3 install --upgrade pip --no-cache-dir \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # RUN /bin/bash -c "apt update" # RUN /bin/bash -c "curl https://dl.min.io/client/mc/release/linux-amd64/mc --output mc && chmod +x mc" COPY requirements.txt $HOME/requirements.txt -RUN /bin/bash -c "pip3 install -r requirements.txt" +RUN /bin/bash -c "pip3 install -r requirements.txt --no-cache-dir" COPY serve.py $HOME/serve.py COPY deploy.sh $HOME/deploy.sh diff --git a/serve-python/Dockerfile.test b/serve-python/Dockerfile.test index 5f1b7f1..b504798 100644 --- a/serve-python/Dockerfile.test +++ b/serve-python/Dockerfile.test @@ -12,15 +12,16 @@ RUN useradd -m -u 1000 $USER # Set working directory (this is where the code should go) WORKDIR $HOME -RUN apt update \ - && apt install python3.7-dev -y \ - && apt install curl -y \ - && apt-get install python3-distutils -y \ +RUN apt-get update \ + && apt-get install ca-certificates -y --no-install-recommends \ + && apt-get install python3.7-dev -y --no-install-recommends \ + && apt-get install curl -y --no-install-recommends \ + && apt-get install python3-distutils -y --no-install-recommends \ && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ && python3.7 get-pip.py \ - && apt install gcc -y \ + && apt-get install gcc -y --no-install-recommends \ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 \ - && pip3 install --upgrade pip \ + && pip3 install --upgrade pip --no-cache-dir \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # RUN /bin/bash -c "apt update" @@ -36,8 +37,9 @@ RUN chmod +x start-script.sh \ && chmod +x deploy.sh \ && chown -R $USER:$USER $HOME -RUN cd models && pip3 install -r requirements.txt && cd .. - +WORKDIR $HOME/models +RUN pip3 install -r requirements.txt --no-cache-dir +WORKDIR $HOME ENV STACKN_MODEL_PATH=$HOME/models ENV PYTHONPATH=$HOME/models