From db32fb6a2a8d6c7e5a737721c814a36972f8c162 Mon Sep 17 00:00:00 2001 From: Blair Chen Date: Mon, 16 May 2022 13:05:18 +0800 Subject: [PATCH] Reduce feathr web api docker image build time --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index f44cf0cdf..8da5c7dc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,14 @@ -FROM ubuntu:20.04 -COPY ./ /usr/src - -RUN apt-get update && \ - apt-get install -y \ - build-essential python3 python3-dev python3-pip librdkafka-dev +FROM python:3.9 -EXPOSE 80 +COPY ./ /usr/src +# Intall package feathr WORKDIR /usr/src/feathr_project -RUN python3 -m pip install -e . +RUN pip install -e . +# Install packages in requirements.txt WORKDIR /usr/src/feathr_project/feathr/api -RUN pip3 install -r requirements.txt +RUN pip install -r requirements.txt +# Start web server CMD [ "uvicorn","app.main:app","--host", "0.0.0.0", "--port", "80" ] \ No newline at end of file