11FROM python:3.10-slim
22
3+ # ## Install Tesseract
4+ ENV SHELL=/bin/bash
5+ ENV CC /usr/bin/clang
6+ ENV CXX /usr/bin/clang++
7+ ENV LANG=C.UTF-8
8+ ENV TESSDATA_PREFIX=/usr/local/share/tessdata
9+
310# Install all build tools needed for our pip installs
411RUN apt update
512RUN apt install -y clang g++ make automake autoconf libtool cmake
613
14+ # # Install the same packages with apt as with apk, but ensure they exist in apt
15+ RUN apt install -y jq git curl
16+ RUN apt install -y file openssl bash tini libpng-dev aspell-en
17+ RUN apt install -y git clang g++ make automake autoconf libtool cmake
18+ RUN apt install -y autoconf-archive wget
19+ RUN mkdir -p /models
20+ RUN wget https://huggingface.co/QuantFactory/Llama-3.2-3B-GGUF/resolve/main/Llama-3.2-3B.Q8_0.gguf?download=true -O /models/Llama-3.2-3B.Q8_0.gguf
21+
722# Install all of our pip packages in a single directory that we can copy to our base image later
823RUN mkdir /install
924WORKDIR /install
1025
1126# Switch back to our base image and copy in all of our built packages and source code
12- # COPY --from=builder /install /usr/local
13- COPY src /app
1427COPY requirements.txt /requirements.txt
1528RUN python3 -m pip install -r /requirements.txt
1629
1730# Install any binary dependencies needed in our final image
18- # RUN apk --no-cache add --update my_binary_dependency
19- # RUN apk --no-cache add jq git curl
20- RUN apt install -y jq git curl
2131
22- ENV SHELL=/bin/bash
23-
24- # ## Install Tesseract
25- ENV CC /usr/bin/clang
26- ENV CXX /usr/bin/clang++
27- ENV LANG=C.UTF-8
28- ENV TESSDATA_PREFIX=/usr/local/share/tessdata
2932
3033# Dev tools
3134WORKDIR /tmp
3235# RUN apk update
3336# RUN apk upgrade
3437
35- # # Install the same packages with apt as with apk, but ensure they exist in apt
36- RUN apt install -y file openssl bash tini libpng-dev aspell-en
37- RUN apt install -y git clang g++ make automake autoconf libtool cmake
38- RUN apt install -y autoconf-archive wget
3938
4039RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
4140
@@ -56,20 +55,26 @@ RUN git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git
5655
5756# RUN curl -fsSL https://ollama.com/install.sh | sh
5857# Install to /usr/local
59- RUN wget https://ollama.com/install.sh -O /usr/local/bin/ollama-install
60- RUN chmod +x /usr/local/bin/ollama-install
61- RUN ls /usr/local/bin
62- RUN sh /usr/local/bin/ollama-install
58+ # RUN wget https://ollama.com/install.sh -O /usr/local/bin/ollama-install
59+ # RUN chmod +x /usr/local/bin/ollama-install
60+ # RUN sh /usr/local/bin/ollama-install
61+ #
62+ # RUN ls -alh /usr/bin
63+ # RUN ollama serve & sleep 2 && ollama pull nezahatkorkmaz/deepseek-v3
64+ # CMD ["sh", "-c", "ollama serve & sleep 2 && python app.py --log-level DEBUG"]
6365
64- RUN ls -alh /usr/bin
65- RUN which ollama
66+ # RUN wget https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf
67+ RUN python3 -m pip install ctransformers --no-binary ctransformers
6668
67- # RUN /usr/local/bin/ollama pull llama3.2
68- RUN ollama serve & sleep 2 && ollama pull nezahatkorkmaz/deepseek-v3
69+ # Finally, lets run our app!
70+ ENV GIN_MODE=release
71+ ENV SHUFFLE_APP_SDK_TIMEOUT=300
72+ # ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/site-packages/ctransformers/lib/basic/libctransformers.so
73+ # RUN chmod 755 /usr/local/lib/python3.10/site-packages/ctransformers/lib/basic/libctransformers.so
6974
70- # RUN rm /usr/local/bin/ollama
71- # RUN cd tesseract && ./autogen.sh && ./configure --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl && make && make install && cd /tmp/src
75+ # RUN apt install -y libffi-dev
7276
73- # Finally, lets run our app!
77+
78+ COPY src /app
7479WORKDIR /app
7580CMD ["python" , "app.py" , "--log-level" , "DEBUG" ]
0 commit comments