haystack/Dockerfile-GPU
Malte Pietsch 2164e8550f
Add gpu dockerfile, improve logging, fix minor bug with filtering (#36)
* add gpu dockerfile. improve logging. fix minor bug with filtering

* fix path
2020-03-12 18:30:42 +01:00

51 lines
1.1 KiB
Plaintext

FROM nvidia/cuda:10.1-runtime
WORKDIR /home/user
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
# Install some basic utilities
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
&& rm -rf /var/lib/apt/lists/*
# install as a package
COPY setup.py requirements.txt README.rst /home/user/
RUN pip install -r requirements.txt
RUN pip install -e .
# copy code
COPY haystack /home/user/haystack
# copy saved FARM models
COPY models /home/user/models
# Optional: copy sqlite db if needed for testing
#COPY qa.db /home/user/
EXPOSE 8000
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# Default config via environment variables (you can still change this at runtime)
ENV DB_HOST=127.0.0.1
ENV DB_USER=""
ENV DB_PW=""
ENV DB_INDEX="document"
# either local path in container or remote name if you want to pull it at container start
ENV MODEL_PATH=deepset/bert-base-cased-squad2
# cmd for running the API
CMD ["uvicorn", "haystack.api.inference:app", "--host", "0.0.0.0", "--port", "8000"]