unstructured/Dockerfile
Matt Robinson 7d66a236f1
fix: correctly install mesa-gl for arm (#3647)
### Summary

Fixes the `arm64` image builds, which will be available again starting
in version `0.15.13`. A fix was implemented upstream in
https://github.com/Unstructured-IO/base-images/pull/47 and a workaround
that installed `x86` packages in the `unstructured` repo was removed.

### Testing

See [this
job](https://github.com/Unstructured-IO/unstructured/actions/runs/10948943594/job/30401108059?pr=3647)
for a successful `arm64` build on the feature branch.
2024-09-20 13:32:47 +00:00

28 lines
1.0 KiB
Docker

FROM quay.io/unstructured-io/base-images:wolfi-base-latest as base
USER root
WORKDIR /app
COPY ./requirements requirements/
COPY unstructured unstructured
COPY test_unstructured test_unstructured
COPY example-docs example-docs
RUN chown -R notebook-user:notebook-user /app && \
apk add font-ubuntu git && \
fc-cache -fv && \
ln -s /usr/bin/python3.11 /usr/bin/python3
USER notebook-user
RUN find requirements/ -type f -name "*.txt" -exec pip3.11 install --no-cache-dir --user -r '{}' ';' && \
python3.11 -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \
python3.11 -c "from unstructured.partition.model_init import initialize; initialize()" && \
python3.11 -c "from unstructured_inference.models.tables import UnstructuredTableTransformerModel; model = UnstructuredTableTransformerModel(); model.initialize('microsoft/table-transformer-structure-recognition')"
ENV PATH="${PATH}:/home/notebook-user/.local/bin"
ENV TESSDATA_PREFIX=/usr/local/share/tessdata
CMD ["/bin/bash"]