unstructured/Dockerfile
Trevor Bossert a78719666a
Build using base image (#625)
This should speed up the builds a lot
2023-05-22 11:13:24 -07:00

43 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:experimental
FROM quay.io/unstructured-io/base-images:centos7.9
ARG PIP_VERSION
# Set up environment
ENV HOME /home/
WORKDIR ${HOME}
RUN mkdir ${HOME}/.ssh && chmod go-rwx ${HOME}/.ssh \
&& ssh-keyscan -t rsa github.com >> /home/.ssh/known_hosts
ENV PYTHONPATH="${PYTHONPATH}:${HOME}"
ENV PATH="/home/usr/.local/bin:${PATH}"
# Copy and install Unstructured
COPY requirements requirements
RUN python3.8 -m pip install pip==${PIP_VERSION} && \
pip install --no-cache -r requirements/base.txt && \
pip install --no-cache -r requirements/test.txt && \
pip install --no-cache -r requirements/huggingface.txt && \
pip install --no-cache -r requirements/dev.txt && \
pip install --no-cache -r requirements/ingest-azure.txt && \
pip install --no-cache -r requirements/ingest-github.txt && \
pip install --no-cache -r requirements/ingest-gitlab.txt && \
pip install --no-cache -r requirements/ingest-google-drive.txt && \
pip install --no-cache -r requirements/ingest-reddit.txt && \
pip install --no-cache -r requirements/ingest-s3.txt && \
pip install --no-cache -r requirements/ingest-slack.txt && \
pip install --no-cache -r requirements/ingest-wikipedia.txt && \
pip install --no-cache -r requirements/local-inference.txt && \
scl enable devtoolset-9 bash && \
pip install --no-cache "detectron2@git+https://github.com/facebookresearch/detectron2.git@e2ce8dc#egg=detectron2"
COPY example-docs example-docs
COPY unstructured unstructured
RUN python3.8 -c "import nltk; nltk.download('punkt')" && \
python3.8 -c "import nltk; nltk.download('averaged_perceptron_tagger')" && \
python3.8 -c "from unstructured.ingest.doc_processor.generalized import initialize; initialize()"
CMD ["/bin/bash"]