2024-07-30 19:49:12 +03:00
|
|
|
# Using a slim version for a smaller base image
|
|
|
|
FROM python:3.11.6-slim-bullseye
|
|
|
|
|
|
|
|
# Install GEOS library, Rust, and other dependencies, then clean up
|
|
|
|
RUN apt-get clean && apt-get update && apt-get install -y \
|
|
|
|
curl \
|
|
|
|
gcc \
|
2024-08-01 16:54:43 +03:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-essential \
|
2024-07-30 19:49:12 +03:00
|
|
|
# Additional dependencies for document handling
|
|
|
|
libmagic-dev \
|
|
|
|
tesseract-ocr \
|
|
|
|
poppler-utils \
|
|
|
|
libreoffice \
|
|
|
|
pandoc && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Set the working directory
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
# Install Poetry
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
|
|
|
|
cd /usr/local/bin && \
|
|
|
|
ln -s /opt/poetry/bin/poetry && \
|
|
|
|
poetry config virtualenvs.create false
|
|
|
|
|
|
|
|
# Add Poetry to PATH
|
|
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
|
|
|
|
|
|
# Copy the current directory contents into the container at /app
|
|
|
|
COPY ./pyproject.toml ./poetry.lock* /code/
|
|
|
|
|
2024-08-01 16:54:43 +03:00
|
|
|
RUN python3 -m pip install nltk && python3 -c "import nltk; nltk.download('punkt')" \
|
|
|
|
&& python3 -c "import nltk; nltk.download('averaged_perceptron_tagger')"
|
|
|
|
|
2024-07-30 19:49:12 +03:00
|
|
|
# Install project dependencies
|
2024-08-01 16:54:43 +03:00
|
|
|
RUN poetry install --with test
|
2024-07-30 19:49:12 +03:00
|
|
|
|
|
|
|
ENV PYTHONPATH=/code
|