daqc commited on
Commit
31668a6
·
1 Parent(s): d5fe7d9

Add basic docker-compose configuration for ollama integration

Browse files
Files changed (1) hide show
  1. docker/compose.basic.yml +54 -0
docker/compose.basic.yml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ # Base application
3
+ app:
4
+ build:
5
+ context: ..
6
+ dockerfile: docker/Dockerfile
7
+ image: synthetic-data-generator:app
8
+ ports:
9
+ - "7860:7860"
10
+ env_file:
11
+ - ../.env
12
+ environment:
13
+ - HF_TOKEN=${HF_TOKEN}
14
+ networks:
15
+ - app-network
16
+ depends_on:
17
+ ollama:
18
+ condition: service_healthy
19
+ required: true
20
+
21
+ # Ollama service
22
+ ollama:
23
+ image: ollama/ollama:${OLLAMA_HARDWARE:-latest}
24
+ ports:
25
+ - "11434:11434"
26
+ command: serve
27
+ env_file:
28
+ - ../.env
29
+ environment:
30
+ - OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-}
31
+ volumes:
32
+ - ollama_data:/root/.ollama
33
+ networks:
34
+ - app-network
35
+ deploy:
36
+ resources:
37
+ reservations:
38
+ devices:
39
+ - driver: nvidia
40
+ count: all
41
+ capabilities: [gpu]
42
+ healthcheck:
43
+ test: ["CMD", "curl", "-f", "http://localhost:11434/api/health"]
44
+ interval: 30s
45
+ timeout: 10s
46
+ retries: 3
47
+
48
+ networks:
49
+ app-network:
50
+ driver: bridge
51
+
52
+ volumes:
53
+ ollama_data:
54
+ driver: local