2021-09-02 17:39:21 +02:00
version : "3"
services :
2021-11-25 16:23:18 +01:00
2021-09-02 17:39:21 +02:00
haystack-api :
build :
context : .
dockerfile : Dockerfile
image : "deepset/haystack-gpu:latest"
# in recent docker-compose version you can enable GPU resources. Make sure to fulfill the prerequisites listed here: https://docs.docker.com/compose/gpu-support/
deploy :
resources :
reservations :
devices :
- driver : nvidia
count : 1
capabilities : [ gpu]
# Mount custom Pipeline YAML and custom Components.
# volumes:
# - ./rest_api/pipeline:/home/user/rest_api/pipeline
ports :
- 8000 : 8000
2021-10-27 17:07:36 +02:00
restart : on -failure
2021-09-02 17:39:21 +02:00
environment :
# See rest_api/pipelines.yaml for configurations of Search & Indexing Pipeline.
2021-09-14 12:28:30 +02:00
- DOCUMENTSTORE_PARAMS_HOST=elasticsearch
2021-11-25 16:23:18 +01:00
- PIPELINE_YAML_PATH=/home/user/rest_api/pipeline/pipelines_dpr.yaml
2021-09-02 17:39:21 +02:00
depends_on :
- elasticsearch
2021-10-13 19:43:58 +02:00
command : "/bin/bash -c 'sleep 10 && gunicorn rest_api.application:app -b 0.0.0.0 -k uvicorn.workers.UvicornWorker --workers 1 --timeout 180'"
2021-11-25 16:23:18 +01:00
2021-09-02 17:39:21 +02:00
elasticsearch :
# This will start an empty elasticsearch instance (so you have to add your documents yourself)
#image: "elasticsearch:7.9.2"
2021-11-25 16:23:18 +01:00
# If you want a demo image instead that is "ready-to-query" with some indexed articles
# about countries and capital cities from Wikipedia:
image : "deepset/elasticsearch-countries-and-capitals"
2021-09-02 17:39:21 +02:00
ports :
- 9200 : 9200
2021-10-27 17:07:36 +02:00
restart : on -failure
2021-09-02 17:39:21 +02:00
environment :
- discovery.type=single-node
2021-11-25 16:23:18 +01:00
2021-09-02 17:39:21 +02:00
ui :
build :
context : ui
dockerfile : Dockerfile
image : "deepset/haystack-streamlit-ui:latest"
ports :
- 8501 : 8501
2021-10-27 17:07:36 +02:00
restart : on -failure
2021-09-02 17:39:21 +02:00
environment :
- API_ENDPOINT=http://haystack-api:8000
- EVAL_FILE=eval_labels_example.csv
2021-11-25 16:23:18 +01:00
- HAYSTACK_UI_DISABLE_FILE_UPLOAD # docker-compose run -e HAYSTACK_UI_DISABLE_FILE_UPLOAD=1 ...
2021-10-13 19:43:58 +02:00
command : "/bin/bash -c 'sleep 15 && streamlit run webapp.py'"