extractous icon indicating copy to clipboard operation
extractous copied to clipboard

Add Dockerfile

Open ddrscott opened this issue 9 months ago • 5 comments

Simplify deployment and development with an example Dockerfile

ddrscott avatar Jan 31 '25 18:01 ddrscott

Thanks for the feedback, can you please elaborate more on your use case? What do you expect the docker container to have?

nmammeri avatar Feb 01 '25 17:02 nmammeri

It should require the minimum requirements for running the Python example. I tried for a couple hours yesterday, but couldn't get past some of the Rust dependencies.

I got this far:

FROM python:3.11-slim

RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    libssl-dev \
    pkg-config \
    zlib1g-dev \
    && curl https://sh.rustup.rs -sSf | sh -s -- -y \
    && . $HOME/.cargo/env

# Set environment variables for Rust
ENV PATH="/root/.cargo/bin:${PATH}"

RUN pip install uv 

WORKDIR /app
COPY requirements.txt .
RUN uv pip install --system -r requirements.txt

and requirements.txt was:

extractous

I'll try again in a few days, but didn't want to duplicate anybody else efforts.

Ultimately, it would be great to be able to run something like:

docker run -it --rm yobix-ai/extractous path/to/example.pdf

ddrscott avatar Feb 02 '25 04:02 ddrscott

Also stuck on cargo errors within a python:3.11-slim container. Any insight would be great.

nathancahill avatar Feb 24 '25 14:02 nathancahill

Also stuck on cargo errors within a python:3.11-slim container. Any insight would be great.

I was able to get a Dockerfile going in a separate project: https://github.com/ddrscott/extractous-api/blob/main/Dockerfile I hacked it together by copying *.so from a mysterious build directory into Python's pip directory. It feels dirty to do it this way, so I didn't try to submit back into this project.

ddrscott avatar Feb 24 '25 15:02 ddrscott

Odd because the library has wheels uploaded to pypi so shouldn't need cargo to install

nathancahill avatar Feb 24 '25 15:02 nathancahill