Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor Dockerfile #1

Open
david30907d opened this issue Feb 9, 2019 · 2 comments
Open

refactor Dockerfile #1

david30907d opened this issue Feb 9, 2019 · 2 comments

Comments

@david30907d
Copy link

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
Copy link
Author

your original image is about 1.85GB
use official image is 1.06GB

@gyang274
Copy link
Owner

gyang274 commented Apr 2, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants