megafarce/Dockerfile

44 lines
1 KiB
Docker

# Dockerfile
FROM python:3.11.10-slim-bullseye
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
curl \
git \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
gcc \
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
pandoc && \
rm -rf /var/lib/apt/lists/* && apt-get clean
COPY . .
RUN pip install --no-cache-dir -r requirements.lock
# Set NLTK data directory environment variable explicitly
ENV NLTK_DATA=/usr/local/share/nltk_data
RUN playwright install --with-deps && \
mkdir -p $NLTK_DATA && \
python -c "import nltk; nltk.download('punkt', download_dir='$NLTK_DATA'); nltk.download('averaged_perceptron_tagger', download_dir='$NLTK_DATA')" && \
python -c "from unstructured.partition.model_init import initialize; initialize()"
EXPOSE 8001
CMD ["python", "app.py"]