forked from danny-avila/rag_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.12 AS main
WORKDIR /app
# Install pandoc and netcat
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pandoc \
netcat-openbsd \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
ENV NLTK_DATA=/app/nltk_data
# Download standard NLTK data, to prevent unstructured from downloading packages at runtime.
# Uses the Python API with explicit package IDs (rather than `python -m nltk.downloader`),
# which never falls back to the interactive prompt that EOFs during a non-interactive build.
# A failed download now fails the build (upstream #315) instead of leaving the image to
# fetch at runtime.
RUN python -c "import nltk, sys; packages = ('punkt_tab', 'averaged_perceptron_tagger', 'averaged_perceptron_tagger_eng'); sys.exit(0 if all(nltk.download(package, download_dir='/app/nltk_data') for package in packages) else 1)"
# Disable Unstructured analytics
ENV SCARF_NO_ANALYTICS=true
COPY . .
CMD ["python", "main.py"]