File size: 1,099 Bytes
be6dbc5
6c20deb
 
0b4448c
 
2a4db2f
 
d3c3946
e11282b
 
 
 
 
 
 
be6dbc5
 
 
 
5a0a3c7
d3c3946
 
be6dbc5
 
d3c3946
 
 
 
8c133e2
4c28492
8c133e2
 
 
a43b69f
4c28492
2a4db2f
 
d3c3946
be6dbc5
d3c3946
 
 
a43b69f
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
FROM python:3.9-slim-bullseye as pdfgpt-chat-img
RUN mkdir -p /.jina
RUN chmod 777 /.jina
RUN mkdir -p /.cache
RUN chmod 777 /.cache
RUN mkdir -p /app
RUN chmod 777 /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

# Expose the secret OPENAI_API_KEY at buildtime and use its value as git remote URL
RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
 git init && \
 git remote add origin $(cat /run/secrets/OPENAI_API_KEY)

COPY requirements_pytorch.txt requirements_pytorch.txt
COPY requirements_api.txt requirements_api.txt
COPY requirements_app.txt requirements_app.txt

RUN pip3 install -r requirements_pytorch.txt
RUN pip3 install -r requirements_api.txt
RUN pip3 install -r requirements_app.txt

WORKDIR /app

COPY intfloat /app/intfloat
COPY app.py app.py
COPY api.py api.py
COPY start_script.sh start_script.sh

RUN chmod 777 /app/start_script.sh

EXPOSE 7860
EXPOSE 8080

HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health

CMD /app/start_script.sh