forked from QuivrHQ/MegaParse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (39 loc) · 1.37 KB
/
Dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.11.10-slim-bullseye
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get upgrade && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
curl \
git \
autoconf \
automake \
build-essential \
libtool \
python-dev \
build-essential \
wget \
gcc \
# Additional dependencies for document handling
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
pandoc && \
rm -rf /var/lib/apt/lists/* && apt-get clean
COPY requirements.lock pyproject.toml README.md ./
COPY libs/megaparse/pyproject.toml libs/megaparse/README.md libs/megaparse/
COPY libs/megaparse_sdk/pyproject.toml libs/megaparse_sdk/README.md libs/megaparse_sdk/
RUN pip install uv
RUN uv pip install --no-cache --system -r requirements.lock
RUN playwright install --with-deps && \
python -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \
python -c "import nltk;nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger_eng')" && \
python -c "from unstructured.partition.model_init import initialize; initialize()"
COPY . .
RUN uv pip install --no-cache --system /app/libs/megaparse /app/libs/megaparse_sdk
EXPOSE 8000
CMD ["uvicorn", "megaparse.api.app:app", "--host", "0.0.0.0", "--port", "8000"]