diff --git a/Dockerfile b/Dockerfile index a571070..c9f788e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,17 @@ -FROM jinaai/jina:master-standard +FROM jinaai/jina:2.0-standard ARG docs_to_index=100 + +RUN apt-get update && apt-get -y install wget git +RUN pip install torch>=1.1.0 +RUN jina hub pull jinahub://TransformerTorchEncoder --install-requirements + COPY . /workspace WORKDIR /workspace -RUN apt-get update && apt-get -y install wget git && pip install -r requirements-docker.txt && python get_data.py && python app.py -t index -n $docs_to_index + +RUN pip install -r requirements.txt && python get_data.py && python app.py -t index -n $docs_to_index + ENTRYPOINT ["python", "app.py" , "-t", "query_restful"] + LABEL author="Alex C-G (alex.cg@jina.ai)" LABEL type="app" LABEL kind="example" diff --git a/Dockerfile.gpu b/Dockerfile.gpu new file mode 100644 index 0000000..24122ac --- /dev/null +++ b/Dockerfile.gpu @@ -0,0 +1,30 @@ +FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime + +ARG docs_to_index=100 + +RUN apt-get update && apt-get -y install wget git +RUN pip install jina[standard]==2.0.4 +RUN jina hub pull jinahub://TransformerTorchEncoder --install-requirements + + +COPY . /workspace +WORKDIR /workspace + +RUN pip install -r requirements.txt && python get_data.py && python app.py -t index -n $docs_to_index + +ENTRYPOINT ["python", "app.py" , "-t", "query_restful"] + +LABEL author="Alex C-G (alex.cg@jina.ai)" +LABEL type="app" +LABEL kind="example" +LABEL avatar="None" +LABEL description="App store example using Jina" +LABEL documentation="https://github.com/alexcg1/jina-app-store-example" +LABEL keywords="[NLP, app store, text, jina, example, search, transformers, torch]" +LABEL license="apache-2.0" +LABEL name="jina-appstore-search" +LABEL platform="linux/amd64" +LABEL update="None" +LABEL url="https://github.com/alexcg1/jina-app-store-example" +LABEL vendor="Jina AI Limited" +LABEL version="0.6.6" \ No newline at end of file diff --git a/requirements-docker.txt b/requirements-docker.txt deleted file mode 100644 index 646a959..0000000 --- a/requirements-docker.txt +++ /dev/null @@ -1,6 +0,0 @@ -# jina[http,transformers,torch,hub]==2.0.0 -pandas==1.2.5 -# copied from TransformerTorchEncoder -torch==1.9.0 -transformers==4.5.1 -jina-commons @ git+https://github.com/jina-ai/jina-commons.git#egg=jina-commons \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e20c791..177f26a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -jina[http,transformers,torch,hub]==2.0.0 +jina[http,hub] pandas==1.2.5