forked from mudler/LocalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
126 lines (121 loc) · 4.13 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
126 lines (121 loc) · 4.13 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
services:
api:
# See https://localai.io/basics/getting_started/#container-images for
# a list of available container images (or build your own with the provided Dockerfile)
# Available images with CUDA, ROCm, SYCL
# Image list (quay.io): https://quay.io/repository/go-skynet/local-ai?tab=tags
# Image list (dockerhub): https://hub.docker.com/r/localai/localai
restart: unless-stopped
container_name: localai
image: localai/localai:master-gpu-nvidia-cuda-13
build:
context: .
dockerfile: Dockerfile
args:
- IMAGE_TYPE=core
- BASE_IMAGE=ubuntu:24.04
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
interval: 1m
timeout: 20m
retries: 5
ports:
- 8080:8080
entrypoint: ["/bin/sh", "-c"]
command: ["apt-get update && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && npm install -g mcp-searxng --prefix /usr/local &&./local-ai run"]
env_file:
- .env
environment:
- MODELS_PATH=/models
- DEBUG=false
- LOCALAI_AUTH=true
- LOCALAI_API_KEY=sk-test
# - DEBUG=true
## Agents (LocalAGI) - https://localai.io/features/agents/
# - LOCALAI_DISABLE_AGENTS=false
# - LOCALAI_AGENT_POOL_DEFAULT_MODEL=hermes-3-llama3.1-8b
# - LOCALAI_AGENT_POOL_ENABLE_SKILLS=true
# - LOCALAI_AGENT_POOL_ENABLE_LOGS=true
# - LOCALAI_AGENT_HUB_URL=https://agenthub.localai.io
## Uncomment to use PostgreSQL for the knowledge base (requires the postgres service below)
# - LOCALAI_AGENT_POOL_VECTOR_ENGINE=postgres
# - LOCALAI_AGENT_POOL_DATABASE_URL=postgresql://localrecall:localrecall@postgres:5432/localrecall?sslmode=disable
volumes:
- /opt/models:/models:cached
- /opt/localai/config:/configuration
- /opt/localai/data:/data
- /opt/localai/backends:/backends
# For NVIDIA GPU support with CDI (recommended for NVIDIA Container Toolkit 1.14+):
# Uncomment the following deploy section and use driver: nvidia.com/gpu.
# Include `utility` in capabilities so nvidia-smi / NVML are available —
# without it, free-VRAM reporting on discrete GPUs is unavailable and the
# Nodes UI will misreport memory usage.
# environment:
# NVIDIA_DRIVER_CAPABILITIES: "compute,utility"
init: true # avoids zombie-reap races that can make nvidia-smi flaky
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
#
# For legacy NVIDIA driver (for older NVIDIA Container Toolkit):
# environment:
# NVIDIA_DRIVER_CAPABILITIES: "compute,utility"
# init: true
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu, utility]
searxng:
container_name: searxng
hostname: searxng
image: docker.io/searxng/searxng:latest
restart: unless-stopped
ports:
- 8081:8080
environment:
- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
- UWSGI_WORKERS=${SEARXNG_UWSGI_WORKERS:-4}
- UWSGI_THREADS=${SEARXNG_UWSGI_THREADS:-4}
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
volumes:
- /opt/localai/searxng:/etc/searxng:Z
valkey:
container_name: searxng-valkey
image: docker.io/valkey/valkey:9-alpine
command: valkey-server --save 30 1 --loglevel warning
restart: always
volumes:
- /opt/localai/valkey-data:/data/
## Uncomment for PostgreSQL-backed knowledge base (see Agents docs)
# postgres:
# image: quay.io/mudler/localrecall:v0.5.2-postgresql
# environment:
# - POSTGRES_DB=localrecall
# - POSTGRES_USER=localrecall
# - POSTGRES_PASSWORD=localrecall
# volumes:
# - postgres_data:/var/lib/postgresql
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U localrecall"]
# interval: 10s
# timeout: 5s
# retries: 5
volumes:
models:
images:
data:
configuration:
backends:
# postgres_data: