-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
48 lines (43 loc) · 1.35 KB
/
compose.yaml
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
services:
ollama:
profiles: [container]
image: ollama/ollama:latest
volumes:
- ollama-data:/root/.ollama
ports:
- 11434:11434
download-llm:
profiles: [container]
#image: curlimages/curl:8.6.0 this image does not work on Gitpod
image: rancher/curlimages-curl:7.73.0
entrypoint: ["curl", "ollama:11434/api/pull", "-d", "{\"name\": \"${LLM}\"}"]
depends_on:
ollama:
condition: service_started
download-local-llm:
profiles: [webapp]
image: rancher/curlimages-curl:7.73.0
entrypoint: ["curl", "http://host.docker.internal:11434/api/pull", "-d", "{\"name\": \"${LLM}\"}"]
# HTTP_PORT=9999 LLM=gemma:2b OLLAMA_BASE_URL=http://host.docker.internal:11434 docker compose --profile webapp up
# HTTP_PORT=8888 LLM=gemma:2b OLLAMA_BASE_URL=http://ollama:11434 docker compose --profile container up
web-app:
profiles: [container, webapp]
build:
context: .
dockerfile: Dockerfile
environment:
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL}
- LLM=${LLM}
- HTTP_PORT=${HTTP_PORT}
# host.docker.internal: listening the host from the container
ports:
- ${HTTP_PORT}:${HTTP_PORT}
develop:
watch:
- action: sync
path: ./public
target: /app/public
- action: rebuild
path: ./main.go
volumes:
ollama-data: