2020-12-27 18:06:09 +05:30
|
|
|
version: "3"
|
2020-05-04 17:28:01 +02:00
|
|
|
services:
|
|
|
|
haystack-api:
|
2020-07-07 16:25:36 +02:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
image: "deepset/haystack-cpu:latest"
|
2021-09-01 16:28:25 +02:00
|
|
|
# Mount custom Pipeline YAML and custom Components.
|
|
|
|
# volumes:
|
|
|
|
# - ./rest_api/pipeline:/home/user/rest_api/pipeline
|
2020-05-04 17:28:01 +02:00
|
|
|
ports:
|
|
|
|
- 8000:8000
|
2021-10-27 17:07:36 +02:00
|
|
|
restart: on-failure
|
2020-05-04 17:28:01 +02:00
|
|
|
environment:
|
2022-04-12 16:41:05 +02:00
|
|
|
# See rest_api/pipeline/pipelines.haystack-pipeline.yml for configurations of Search & Indexing Pipeline.
|
2021-09-14 12:28:30 +02:00
|
|
|
- DOCUMENTSTORE_PARAMS_HOST=elasticsearch
|
2022-03-21 14:47:04 +01:00
|
|
|
- PIPELINE_YAML_PATH=/home/user/rest_api/pipeline/pipelines.haystack-pipeline.yml
|
2021-11-30 18:11:54 +01:00
|
|
|
- CONCURRENT_REQUEST_PER_WORKER
|
2020-07-07 16:25:36 +02:00
|
|
|
depends_on:
|
|
|
|
- elasticsearch
|
2022-04-11 13:26:27 +02:00
|
|
|
# Starts REST API with only 2 workers so that it can be run on systems with just 4GB of memory
|
|
|
|
# If you need to handle large loads of incoming requests and have memory to spare, consider increasing the number of workers
|
|
|
|
command: "/bin/bash -c 'sleep 10 && gunicorn rest_api.application:app -b 0.0.0.0 -k uvicorn.workers.UvicornWorker --workers 2 --timeout 180'"
|
2020-05-04 17:28:01 +02:00
|
|
|
elasticsearch:
|
2020-07-07 16:25:36 +02:00
|
|
|
# This will start an empty elasticsearch instance (so you have to add your documents yourself)
|
2021-03-05 10:55:36 +01:00
|
|
|
#image: "elasticsearch:7.9.2"
|
2021-12-03 15:58:47 +01:00
|
|
|
# If you want a demo image instead that is "ready-to-query" with some indexed articles
|
2021-11-25 16:23:18 +01:00
|
|
|
# about countries and capital cities from Wikipedia:
|
|
|
|
image: "deepset/elasticsearch-countries-and-capitals"
|
2020-07-07 16:25:36 +02:00
|
|
|
ports:
|
|
|
|
- 9200:9200
|
2021-10-27 17:07:36 +02:00
|
|
|
restart: on-failure
|
2020-05-04 17:28:01 +02:00
|
|
|
environment:
|
2020-12-27 18:06:09 +05:30
|
|
|
- discovery.type=single-node
|
|
|
|
ui:
|
2021-04-07 17:53:32 +02:00
|
|
|
build:
|
|
|
|
context: ui
|
|
|
|
dockerfile: Dockerfile
|
2021-09-02 17:39:21 +02:00
|
|
|
image: "deepset/haystack-streamlit-ui:latest"
|
2020-12-27 18:06:09 +05:30
|
|
|
ports:
|
|
|
|
- 8501:8501
|
2021-10-27 17:07:36 +02:00
|
|
|
restart: on-failure
|
2020-12-27 18:06:09 +05:30
|
|
|
environment:
|
|
|
|
- API_ENDPOINT=http://haystack-api:8000
|
2021-04-22 17:30:17 +02:00
|
|
|
- EVAL_FILE=eval_labels_example.csv
|
2021-11-30 18:11:54 +01:00
|
|
|
# The value fot the following variables will be read from the host, if present.
|
|
|
|
# They can also be temporarily set for docker-compose, for example:
|
|
|
|
# DISABLE_FILE_UPLOAD=1 DEFAULT_DOCS_FROM_RETRIEVER=5 docker-compose up
|
|
|
|
- DISABLE_FILE_UPLOAD
|
|
|
|
- DEFAULT_QUESTION_AT_STARTUP
|
|
|
|
- DEFAULT_DOCS_FROM_RETRIEVER
|
|
|
|
- DEFAULT_NUMBER_OF_ANSWERS
|
2022-02-09 17:35:18 +01:00
|
|
|
command: "/bin/bash -c 'sleep 15 && python -m streamlit run ui/webapp.py'"
|