Spaces:
Sleeping

wang16888 commited on
Commit
329832c
·
verified ·
1 Parent(s): e8b1ef7

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
6
+
7
+ WORKDIR /app
8
+
9
+ # Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL
10
+
11
+ COPY --chown=user ./requirements.txt requirements.txt
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
+
14
+ RUN --mount=type=secret,id=PINECONE_API_KEY,mode=0444,required=true \
15
+ cat /run/secrets/PINECONE_API_KEY > /app/test
16
+
17
+ RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
18
+ cat /run/secrets/OPENAI_API_KEY > /app/test
19
+
20
+ RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
21
+ cat /run/secrets/HF_TOKEN > /app/test
22
+
23
+ COPY --chown=user ./app /app
24
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]