Spaces:
Sleeping
Sleeping
Commit
·
8679f57
1
Parent(s):
0d711d7
added docker files and app.py
Browse files
Docker
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
build-essential \
|
| 7 |
+
curl \
|
| 8 |
+
software-properties-common \
|
| 9 |
+
git \
|
| 10 |
+
git-lfs \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
RUN git lfs install
|
| 14 |
+
|
| 15 |
+
RUN echo "$ssh_prv_key" > /root/.ssh/id_rsa && \
|
| 16 |
+
echo "$ssh_pub_key" > /root/.ssh/id_rsa.pub && \
|
| 17 |
+
chmod 600 /root/.ssh/id_rsa && \
|
| 18 |
+
chmod 600 /root/.ssh/id_rsa.pub && \
|
| 19 |
+
ssh-keyscan github.com >> /root/.ssh/known_hosts && \
|
| 20 |
+
git pull && \
|
| 21 |
+
rm /root/.ssh/id_rsa*
|
| 22 |
+
|
| 23 |
+
COPY ./rag_test/requirements.txt /app/requirements.txt
|
| 24 |
+
|
| 25 |
+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 26 |
+
|
| 27 |
+
COPY . .
|
| 28 |
+
|
| 29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
app = FastAPI()
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
@app.get("/")
|
| 8 |
+
async def root():
|
| 9 |
+
return {"message": "Hello World!"}
|