First tests with the Docker containers

This commit is contained in:
scriptos 2024-11-27 21:38:00 +01:00
parent 6e0770833e
commit c64ab6a99f
7 changed files with 39 additions and 8 deletions

9
Dockerfile.ollama Normal file
View File

@ -0,0 +1,9 @@
FROM ollama/ollama
RUN ollama pull llama3.1:8b-instruct-q5_K_M
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Standardbefehl zum Starten des Servers
CMD ["/start.sh"]

View File

@ -215,4 +215,4 @@ class ollamarama:
if __name__ == "__main__": if __name__ == "__main__":
ollamarama = ollamarama() ollamarama = ollamarama()
asyncio.run(ollamarama.main()) asyncio.run(ollamarama.main())

View File

@ -1,6 +1,3 @@
matrix-nio matrix-nio
requests requests
markdown markdown
asyncio
datetime
json

View File

@ -19,7 +19,7 @@
}, },
"ollama": "ollama":
{ {
"api_base": "http://localhost:11434", "api_base": "http://ollama:11434",
"options": "options":
{ {
"temperature": 0.8, "temperature": 0.8,

View File

@ -1,16 +1,33 @@
services: services:
ollama:
hostname: ollama
container_name: ollama
build:
context: .
dockerfile: Dockerfile.ollama
image: ollama/ollama
container_name: ollama
ports:
- "11434:11434"
volumes:
- ./data/ollama/history:/root/.ollama
- ./data/ollama/models:/usr/share/ollama
restart: unless-stopped
matrix-chatbot: matrix-chatbot:
container_name: matrix-chatbot container_name: matrix-chatbot
hostname: matrix-chatbot hostname: matrix-chatbot
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile.chatbot
networks: networks:
dockernet: dockernet:
ipv4_address: 172.16.0.50 ipv4_address: 172.16.0.50
depends_on:
- ollama
volumes: volumes:
- ./data/config.json:/app/config.json:ro - ./data/chatbot/config.json:/app/config.json:ro
restart: unless-stopped restart: unless-stopped
networks: networks:

8
start.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# Modelle installieren
ollama pull llama3.1:8b-instruct-q5_K_M
ollama pull llama3.2
# Server starten
ollama serve