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

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

View File

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

View File

@ -1,16 +1,33 @@
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:
container_name: matrix-chatbot
hostname: matrix-chatbot
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile.chatbot
networks:
dockernet:
ipv4_address: 172.16.0.50
depends_on:
- ollama
volumes:
- ./data/config.json:/app/config.json:ro
- ./data/chatbot/config.json:/app/config.json:ro
restart: unless-stopped
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