haystack/Dockerfile-GPU
Malte Pietsch 76c5c1d6aa
Improve deployment of REST API (Configs, logging, minor bugs) (#40)
* remove env variables from dockerfiles

* add more config options to rest api. make fields optional. change to elasticsearch as default

* skip reader if retriever doesn't return anything

* add more config params to farm reader. fix top_k_per_sample

* update FARM version
2020-03-18 12:26:13 +01:00

42 lines
925 B
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/*
# copy code
COPY haystack /home/user/haystack
# install as a package
COPY setup.py requirements.txt README.rst /home/user/
RUN pip install -r requirements.txt
RUN pip install -e .
# 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
# cmd for running the API
CMD ["uvicorn", "haystack.api.inference:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--limit-concurrency", "3"]