Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

fix: use layer cache to speed up docker building #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 ([email protected])"
LABEL type="app"
LABEL kind="example"
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -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 ([email protected])"
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"
6 changes: 0 additions & 6 deletions requirements-docker.txt

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jina[http,transformers,torch,hub]==2.0.0
jina[http,hub]
pandas==1.2.5