fpadron commited on
Commit
d1e0588
·
1 Parent(s): 6b73bad
Files changed (2) hide show
  1. Dockerfile +14 -0
  2. api.py +1 -1
Dockerfile CHANGED
@@ -1,7 +1,21 @@
 
1
  FROM python:3.9-slim
 
 
2
  WORKDIR /app
 
 
3
  COPY requirements.txt requirements.txt
4
  RUN pip install --no-cache-dir -r requirements.txt
 
 
5
  COPY . .
 
 
 
 
 
6
  EXPOSE 7860
 
 
7
  CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image
2
  FROM python:3.9-slim
3
+
4
+ # Set working directory
5
  WORKDIR /app
6
+
7
+ # Copy requirements and install dependencies
8
  COPY requirements.txt requirements.txt
9
  RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # Copy all app files into the container
12
  COPY . .
13
+
14
+ # Ensure the qdrant directory exists and is writable
15
+ RUN mkdir -p /app/qdrant && chmod -R 777 /app/qdrant
16
+
17
+ # Expose the application port
18
  EXPOSE 7860
19
+
20
+ # Start the FastAPI application
21
  CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
api.py CHANGED
@@ -52,7 +52,7 @@ async def startup_event():
52
  )
53
 
54
  try:
55
- qdrant_client = QdrantClient(path="qdrant/")
56
  qdrant = QdrantVectorStore(qdrant_client, "MyCollection", embed_model, distance="Dot")
57
  except Exception as e:
58
  print(f"❌ Error initializing Qdrant: {e}")
 
52
  )
53
 
54
  try:
55
+ qdrant_client = QdrantClient(path="/app/qdrant/meta.json")
56
  qdrant = QdrantVectorStore(qdrant_client, "MyCollection", embed_model, distance="Dot")
57
  except Exception as e:
58
  print(f"❌ Error initializing Qdrant: {e}")