refactor Dockerfile
david30907d opened this issue · 2 comments
david30907d commented
use official image would make the image size much smaller~
FROM tensorflow/serving:1.11.1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python-numpy \
python-setuptools \
python-pip \
uwsgi-core \
uwsgi-plugin-python \
curl \
&& pip install --no-cache-dir tensorflow tensorflow-serving-api grpcio requests \
&& rm -rf /tmp/* /var/cache/apk/* /var/lib/apt/lists/* \
&& apt-get clean
WORKDIR /
# Copy the model servables directory contents into the container at /app
COPY ./scripts/gdrive.sh .
RUN ./gdrive.sh https://drive.google.com/a/smail.nchu.edu.tw/uc\?export\=download\&confirm\=rkYp\&id\=1Xn_nH3OXEEDwi8CMPxHjUR6QbRmxOjHE \
&& tar -zxvf tf_servables.tar.gz \
&& rm tf_servables.tar.gz \
&& mkdir /app \
&& apt-get remove --auto-remove --purge -y curl \
&& mv tf_servables /app/
COPY ./app/slim_unified_client_rest.py /app/slim_unified_client_rest.py
COPY ./app/slim_unified_client_rest.ini /app/slim_unified_client_rest.ini
COPY ./docker-entrypoint.sh .
# Setup EXPOSE
EXPOSE 9000
EXPOSE 80
# Setup ENTRYPOINT
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["server"]
david30907d commented
your original image is about 1.85GB
use official image is 1.06GB
gyang274 commented
Thank you!