-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (115 loc) · 3.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
126 lines (115 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.8'
services:
# LogWhisperer with integrated Ollama
logwhisperer:
image: logwhisperer:latest
build:
context: .
dockerfile: Dockerfile
args:
BUILD_DATE: ${BUILD_DATE:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")}
VCS_REF: ${VCS_REF:-$(git rev-parse --short HEAD)}
VERSION: ${VERSION:-latest}
container_name: logwhisperer
restart: unless-stopped
environment:
# LogWhisperer configuration
- LOGWHISPERER_CONFIG=/etc/logwhisperer/config.yaml
- DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL:-}
# Ollama configuration (using integrated Ollama)
- OLLAMA_HOST=http://localhost:11434
- OLLAMA_MODEL=${OLLAMA_MODEL:-mistral}
- OLLAMA_MODELS_DIR=/opt/logwhisperer/models
# Logging
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
# Configuration
- ./config.yaml:/etc/logwhisperer/config.yaml:ro
# Persistent data
- logwhisperer_logs:/var/log/logwhisperer
- logwhisperer_reports:/opt/logwhisperer/reports
- logwhisperer_models:/opt/logwhisperer/models
# For monitoring host logs (optional)
- /var/log:/host/logs:ro
# For monitoring Docker logs (optional)
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- logwhisperer
healthcheck:
test: ["CMD", "logwhisperer", "--version"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Uncomment to expose Ollama API externally
# ports:
# - "11434:11434"
# Separate Ollama service (alternative setup)
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
profiles:
- external-ollama
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
networks:
- logwhisperer
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 3
# LogWhisperer using external Ollama
logwhisperer-external:
extends:
service: logwhisperer
profiles:
- external-ollama
environment:
- LOGWHISPERER_CONFIG=/etc/logwhisperer/config.yaml
- DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL:-}
- OLLAMA_HOST=http://ollama:11434
- OLLAMA_MODEL=${OLLAMA_MODEL:-mistral}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
depends_on:
ollama:
condition: service_healthy
# Development version with source code mounted
logwhisperer-dev:
build:
context: .
dockerfile: Dockerfile.dev
container_name: logwhisperer-dev
profiles:
- development
environment:
- LOGWHISPERER_CONFIG=/etc/logwhisperer/config.yaml
- DISCORD_WEBHOOK_URL=${DISCORD_WEBHOOK_URL:-}
- OLLAMA_HOST=http://localhost:11434
- PYTHONUNBUFFERED=1
- LOG_LEVEL=DEBUG
volumes:
# Mount source code for development
- .:/app:ro
- ./config.yaml:/etc/logwhisperer/config.yaml:ro
- logwhisperer_logs:/var/log/logwhisperer
- logwhisperer_reports:/opt/logwhisperer/reports
- logwhisperer_models:/opt/logwhisperer/models
networks:
- logwhisperer
command: python /app/logwhisperer.py monitor
networks:
logwhisperer:
driver: bridge
volumes:
logwhisperer_logs:
driver: local
logwhisperer_reports:
driver: local
logwhisperer_models:
driver: local
ollama_data:
driver: local