This commit is contained in:
2025-11-11 17:20:56 +01:00
parent 324751eb5d
commit 901e8166cd
14 changed files with 1762 additions and 4 deletions

View File

@@ -1,4 +1,61 @@
# Munich News Daily - Docker Compose Configuration
#
# GPU Support:
# To enable GPU acceleration for Ollama (5-10x faster):
# 1. Check GPU availability: ./check-gpu.sh
# 2. Start with GPU: ./start-with-gpu.sh
# Or manually: docker-compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
#
# See docs/OLLAMA_SETUP.md for detailed setup instructions
services:
# Ollama AI Service
ollama:
image: ollama/ollama:latest
container_name: munich-news-ollama
restart: unless-stopped
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
networks:
- munich-news-network
# GPU support (uncomment if you have NVIDIA GPU)
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
healthcheck:
test: ["CMD-SHELL", "ollama list || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Ollama Model Loader - Pulls phi3:latest on startup
ollama-setup:
image: curlimages/curl:latest
container_name: munich-news-ollama-setup
depends_on:
ollama:
condition: service_healthy
networks:
- munich-news-network
entrypoint: /bin/sh
command: >
-c "
echo 'Waiting for Ollama service to be ready...' &&
sleep 5 &&
echo 'Pulling phi3:latest model via API...' &&
curl -X POST http://ollama:11434/api/pull -d '{\"name\":\"phi3:latest\"}' &&
echo '' &&
echo 'Model phi3:latest pull initiated!'
"
restart: "no"
# MongoDB Database
mongodb:
image: mongo:latest
@@ -32,6 +89,7 @@ services:
restart: unless-stopped
depends_on:
- mongodb
- ollama
environment:
- MONGODB_URI=mongodb://${MONGO_USERNAME:-admin}:${MONGO_PASSWORD:-changeme}@mongodb:27017/
- TZ=Europe/Berlin
@@ -101,6 +159,8 @@ volumes:
driver: local
mongodb_config:
driver: local
ollama_data:
driver: local
networks:
munich-news-network: