diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..fdc976d48 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +__pycache__ +*.pyc +*.pyo +*.pyd +.Python +env +pip-log.txt +pip-delete-this-directory.txt +.tox +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +*.log +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..f940e34fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.7-slim + +ENV MODELS_DIR /mnt/models + +RUN apt-get update && \ + apt-get -y --no-install-recommends install \ + libgomp1 + +WORKDIR /workspace +COPY setup.py . +# TODO: This busts the cache, which we don't want, but I can't see any +# way to install only deps from setup.py +COPY ./mlserver/ ./mlserver/ +RUN pip install .[all] + +COPY ./mlserver/ ./mlserver/ + +CMD mlserver start $MODELS_DIR + diff --git a/Makefile b/Makefile index 08da866fa..bc6b24d9c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +VERSION=0.1.0 +IMAGE_NAME=seldonio/mlserver + install-dev: pip install -r requirements-dev.txt pip install --editable .[all] @@ -9,6 +12,9 @@ run: mlserver start \ ./tests/testdata +build: + docker build . -t ${IMAGE_NAME}:${VERSION} + test: tox