mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-27 15:08:43 +00:00
build: Use uvicorn instead of gunicorn as server in REST API's Dockerfile (#4304)
* Use uvicorn instead of gunicorn as server * Added comments and changed service names * comments improvised --------- Co-authored-by: Mayank Jobanputra <mayankjobanputra@gmail.com>
This commit is contained in:
parent
f90ffb6851
commit
e3503a92c9
@ -3,8 +3,10 @@ ARG base_image
|
||||
|
||||
FROM ${base_image}:${base_image_tag}
|
||||
|
||||
ENV SERVICE_NAME="gunicorn-service"
|
||||
ENV SERVICE_NAME="haystackd"
|
||||
|
||||
# Haystack pipelines are run by the "haystackd" user.
|
||||
# This helps keep the process and log management organized.
|
||||
RUN addgroup --gid 1001 $SERVICE_NAME && \
|
||||
adduser --gid 1001 --uid 1001 --shell /bin/false --disabled-password $SERVICE_NAME && \
|
||||
mkdir -p /var/log/$SERVICE_NAME && \
|
||||
@ -19,7 +21,8 @@ ENV FILE_UPLOAD_PATH="/opt/file-upload"
|
||||
|
||||
ENV TIKA_LOG_PATH="/var/log/$SERVICE_NAME/"
|
||||
|
||||
# The uvicorn server runs on port 8000, and it needs to be accessible from outside the container.
|
||||
EXPOSE 8000
|
||||
|
||||
USER $SERVICE_NAME
|
||||
CMD ["gunicorn", "rest_api.application:app", "-b", "0.0.0.0", "-k", "uvicorn.workers.UvicornWorker", "--workers", "1", "--timeout", "1000"]
|
||||
CMD ["uvicorn", "rest_api.application:app", "--host", "0.0.0.0"]
|
||||
|
||||
@ -28,7 +28,6 @@ dependencies = [
|
||||
"farm-haystack",
|
||||
"fastapi<1",
|
||||
"uvicorn<1",
|
||||
"gunicorn<21",
|
||||
"python-multipart<1", # optional FastAPI dependency for form data
|
||||
"pynvml",
|
||||
"psutil"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user