Spaces:
Sleeping
Sleeping
Changed app_port to 7860 and cleaned up the YAML metadata
Browse files- Dockerfile +2 -13
- README.md +6 -6
Dockerfile
CHANGED
|
@@ -1,31 +1,20 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.13-slim
|
| 3 |
|
| 4 |
-
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy the requirements file into the container
|
| 14 |
COPY requirements.txt .
|
| 15 |
-
|
| 16 |
-
# Install any needed packages specified in requirements.txt
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# Copy the rest of the application code into the container
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
|
| 23 |
-
EXPOSE 8000
|
| 24 |
|
| 25 |
-
# Define environment variables (placeholders, should be provided at runtime)
|
| 26 |
ENV PINECONE_API_KEY=""
|
| 27 |
ENV PINECONE_INDEX_NAME="locus-rag"
|
| 28 |
ENV MISTRAL_API_KEY=""
|
| 29 |
|
| 30 |
-
|
| 31 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.13-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential \
|
| 6 |
curl \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
|
|
|
| 9 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
|
|
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
+
EXPOSE 7860
|
|
|
|
| 15 |
|
|
|
|
| 16 |
ENV PINECONE_API_KEY=""
|
| 17 |
ENV PINECONE_INDEX_NAME="locus-rag"
|
| 18 |
ENV MISTRAL_API_KEY=""
|
| 19 |
|
| 20 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
-
title: Locus
|
| 3 |
emoji: 🤖
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
-
app_port:
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
|
@@ -82,9 +82,9 @@ python3 scripts/index_data.py
|
|
| 82 |
|
| 83 |
### Locally
|
| 84 |
```bash
|
| 85 |
-
uvicorn app.main:app --host 0.0.0.0 --port
|
| 86 |
```
|
| 87 |
-
The API docs will be available at `http://localhost:
|
| 88 |
|
| 89 |
### Using Docker
|
| 90 |
```bash
|
|
@@ -92,7 +92,7 @@ The API docs will be available at `http://localhost:8000/docs`.
|
|
| 92 |
docker build -t locus-rag-bot .
|
| 93 |
|
| 94 |
# Run the container
|
| 95 |
-
docker run -p
|
| 96 |
```
|
| 97 |
|
| 98 |
## API Usage
|
|
@@ -103,7 +103,7 @@ docker run -p 8000:8000 --env-file .env locus-rag-bot
|
|
| 103 |
### Query the Bot
|
| 104 |
`POST /query`
|
| 105 |
```bash
|
| 106 |
-
curl -X POST "http://localhost:
|
| 107 |
-H "Content-Type: application/json" \
|
| 108 |
-d '{"question": "What is LOCUS?"}'
|
| 109 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Locus RAG Bot
|
| 3 |
emoji: 🤖
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
|
|
|
| 82 |
|
| 83 |
### Locally
|
| 84 |
```bash
|
| 85 |
+
uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload
|
| 86 |
```
|
| 87 |
+
The API docs will be available at `http://localhost:7860/docs`.
|
| 88 |
|
| 89 |
### Using Docker
|
| 90 |
```bash
|
|
|
|
| 92 |
docker build -t locus-rag-bot .
|
| 93 |
|
| 94 |
# Run the container
|
| 95 |
+
docker run -p 7860:7860 --env-file .env locus-rag-bot
|
| 96 |
```
|
| 97 |
|
| 98 |
## API Usage
|
|
|
|
| 103 |
### Query the Bot
|
| 104 |
`POST /query`
|
| 105 |
```bash
|
| 106 |
+
curl -X POST "http://localhost:7860/query" \
|
| 107 |
-H "Content-Type: application/json" \
|
| 108 |
-d '{"question": "What is LOCUS?"}'
|
| 109 |
```
|