Spaces:
Runtime error
Runtime error
Remove Dockerfile and .dockerignore as part of project cleanup
Browse files- .dockerignore +0 -16
- Dockerfile +0 -36
- README.md +0 -44
.dockerignore
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
# Python caches
|
2 |
-
__pycache__/
|
3 |
-
*.py[cod]
|
4 |
-
|
5 |
-
# Git and GitHub
|
6 |
-
.git
|
7 |
-
.github
|
8 |
-
|
9 |
-
# Development envs
|
10 |
-
.env
|
11 |
-
.venv
|
12 |
-
venv/
|
13 |
-
|
14 |
-
# Other ignored files
|
15 |
-
*.db
|
16 |
-
*.log
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
# syntax=docker/dockerfile:1
|
2 |
-
|
3 |
-
FROM python:3.10-slim as base
|
4 |
-
|
5 |
-
# Install system dependencies and Ollama
|
6 |
-
RUN apt-get update && \
|
7 |
-
apt-get install -y curl gnupg && \
|
8 |
-
rm -rf /var/lib/apt/lists/* && \
|
9 |
-
curl -fsSL https://ollama.com/install.sh | sh
|
10 |
-
|
11 |
-
# Create non-root user
|
12 |
-
RUN useradd --create-home --uid 1000 botuser
|
13 |
-
|
14 |
-
WORKDIR /app
|
15 |
-
|
16 |
-
# Pull models at build time
|
17 |
-
ENV OLLAMA_MODEL="qwen3"
|
18 |
-
ENV OLLAMA_EMBEDDING_MODEL="nomic-embed-text"
|
19 |
-
RUN ollama pull "$OLLAMA_MODEL" && ollama pull "$OLLAMA_EMBEDDING_MODEL"
|
20 |
-
|
21 |
-
# Install Python dependencies
|
22 |
-
COPY requirements.txt ./
|
23 |
-
RUN pip install --no-cache-dir --upgrade pip && \
|
24 |
-
pip install --no-cache-dir -r requirements.txt
|
25 |
-
|
26 |
-
# Copy application source
|
27 |
-
COPY . .
|
28 |
-
|
29 |
-
# Entrypoint script manages Ollama and the bot
|
30 |
-
COPY entrypoint.sh /entrypoint.sh
|
31 |
-
RUN chmod +x /entrypoint.sh
|
32 |
-
|
33 |
-
USER botuser
|
34 |
-
ENV PYTHONUNBUFFERED=1
|
35 |
-
|
36 |
-
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
@@ -36,47 +36,3 @@ async with ChatSession() as chat:
|
|
36 |
When using the Discord bot, attach one or more text files to a message to
|
37 |
upload them automatically. The bot responds with the location of each document
|
38 |
inside the VM so they can be referenced in subsequent prompts.
|
39 |
-
|
40 |
-
## API Server
|
41 |
-
|
42 |
-
An HTTP API is provided using FastAPI. Run the server with:
|
43 |
-
|
44 |
-
```bash
|
45 |
-
python server.py
|
46 |
-
```
|
47 |
-
|
48 |
-
Send a POST request to `/chat` with the fields `user`, `session` and `prompt` to
|
49 |
-
receive the assistant's reply. Conversation history is persisted in
|
50 |
-
`chat.db`. Use the `/reset` endpoint to clear previous messages for a session.
|
51 |
-
|
52 |
-
## Docker
|
53 |
-
|
54 |
-
A Dockerfile is provided to run the Discord bot along with an Ollama server. The image installs Ollama, pulls the LLM and embedding models, and starts both the server and the bot.
|
55 |
-
|
56 |
-
Build the image:
|
57 |
-
|
58 |
-
```bash
|
59 |
-
docker build -t llm-discord-bot .
|
60 |
-
```
|
61 |
-
|
62 |
-
Run the container:
|
63 |
-
|
64 |
-
```bash
|
65 |
-
docker run -e DISCORD_TOKEN=your-token llm-discord-bot
|
66 |
-
```
|
67 |
-
|
68 |
-
The environment variables `OLLAMA_MODEL` and `OLLAMA_EMBEDDING_MODEL` can be set at build or run time to specify which models to download.
|
69 |
-
|
70 |
-
## Frontend
|
71 |
-
|
72 |
-
A simple React application is included under `frontend` for interacting with the API.
|
73 |
-
Install dependencies and start the development server:
|
74 |
-
|
75 |
-
```bash
|
76 |
-
cd frontend
|
77 |
-
npm install
|
78 |
-
npm run dev
|
79 |
-
```
|
80 |
-
|
81 |
-
Set `VITE_API_BASE_URL` in `.env` to point to the backend (defaults to `http://localhost:8000`).
|
82 |
-
Build the production bundle with `npm run build`.
|
|
|
36 |
When using the Discord bot, attach one or more text files to a message to
|
37 |
upload them automatically. The bot responds with the location of each document
|
38 |
inside the VM so they can be referenced in subsequent prompts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|