-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathcompose.ollama.yml
43 lines (42 loc) · 1.29 KB
/
compose.ollama.yml
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
services:
ollama:
image: ollama/ollama:${HARBOR_OLLAMA_VERSION}
container_name: ${HARBOR_CONTAINER_PREFIX}.ollama
env_file:
- ./.env
- ./ollama/override.env
volumes:
- ${HARBOR_OLLAMA_CACHE}:/root/.ollama
- ${HARBOR_HF_CACHE}:/root/.cache/huggingface
- ${HARBOR_LLAMACPP_CACHE}:/root/.cache/llama.cpp
- ${HARBOR_VLLM_CACHE}:/root/.cache/vllm
- ./ollama/modelfiles:/modelfiles
tty: true
ports:
- ${HARBOR_OLLAMA_HOST_PORT}:11434
healthcheck:
test: [ "CMD-SHELL", "bash", "-c", "{ printf >&3 'GET / HTTP/1.0\\r\\n\\r\\n'; cat <&3; } 3<>/dev/tcp/localhost/11434 | grep 'Ollama is' || exit 1" ]
interval: 1s
timeout: 5s
retries: 3
restart: unless-stopped
networks:
- harbor-network
# Runs an "init" script once during the first start
# of ollama service
ollama-init:
container_name: ${HARBOR_CONTAINER_PREFIX}.ollama-init
depends_on:
ollama:
condition: service_healthy
image: ollama/ollama:${HARBOR_OLLAMA_VERSION}
env_file:
- ./.env
- ./ollama/override.env
volumes:
- ${HARBOR_OLLAMA_CACHE}:/root/.ollama
- ./ollama/init_entrypoint.sh:/init_entrypoint.sh
entrypoint: /init_entrypoint.sh
tty: true
networks:
- harbor-network