File size: 1,326 Bytes
cc9f92c
 
 
 
 
feaa33a
 
 
 
 
 
 
 
10e3225
feaa33a
7e7a852
 
 
cc9f92c
7e7a852
 
 
 
cc9f92c
7e7a852
cc9f92c
 
3c275b2
 
10e3225
 
3c275b2
10e3225
 
 
efa2743
cc9f92c
efa2743
 
 
 
 
 
 
 
cc9f92c
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Use a Python base image
FROM  nvidia/cuda:12.4.1-runtime-ubuntu22.04

# Set the working directory
WORKDIR /DocQA
# Install dependencies
RUN apt-get update && apt-get install -y \
    git \
    python3.10 \
    python3-pip \
    && apt-get clean
RUN apt-get install poppler-utils -y


RUN pip3 install torch --index-url https://download.pytorch.org/whl/cu121
RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app
# Copy the requirements.txt file
COPY --chown=user requirements.txt $HOME/app

RUN pip install --no-cache-dir -r requirements.txt 
RUN mkdir -p ~/.streamlit && \
    echo "\
[server]\n\
headless = true\n\
port = \$PORT\n\
enableXsrfProtection=false\n\
enableCORS = false\n\
" > ~/.streamlit/config.toml

# Copy the rest of the application codeDocQA
COPY --chown=user images $HOME/app
COPY --chown=user app.py $HOME/app
COPY --chown=user ./classification.py $HOME/app
COPY --chown=user donut_inference.py $HOME/app
COPY --chown=user non_form_llama_parse.py $HOME/app
COPY --chown=user RAG.py $HOME/app
COPY --chown=user best_resnet152_model.h5 $HOME/app
COPY --chown=user Model $HOME/app

# Expose the port the app runs on
# EXPOSE 7860
EXPOSE 8501

# Start the application
# CMD ["streamlit", "run", "app.py"]
ENTRYPOINT ["streamlit", "run","app.py"]