-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (84 loc) · 2.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
90 lines (84 loc) · 2.03 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
services:
api:
build: .
container_name: fastify-template-api
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "3000:3000"
depends_on:
mongo:
condition: service_healthy
seed:
condition: service_completed_successfully
ollama:
condition: service_started
restart: unless-stopped
seed:
build: .
container_name: fastify-template-seed
env_file:
- .env
depends_on:
mongo:
condition: service_healthy
command: ["npm", "run", "seed"]
restart: "no"
frontend:
build:
context: ./frontend
container_name: fastify-template-frontend
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8080:80"
depends_on:
- api
restart: unless-stopped
mongo:
image: mongo:8
container_name: fastify-template-mongo
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "mongodb://localhost:27017/admin", "--eval", "db.runCommand({ ping: 1 }).ok"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
restart: unless-stopped
ollama:
image: ollama/ollama:latest
container_name: fastify-template-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
restart: unless-stopped
ollama-init:
image: curlimages/curl:8.12.1
container_name: fastify-template-ollama-init
depends_on:
- ollama
command: >
sh -c "
until curl -sf http://ollama:11434/api/tags > /dev/null; do
echo 'Aguardando Ollama...';
sleep 2;
done;
echo 'Baixando modelo AI_MODEL=${AI_MODEL:-llama3.2:3b}';
curl -s http://ollama:11434/api/pull
-H 'Content-Type: application/json'
-d '{\"name\":\"${AI_MODEL:-llama3.2:3b}\"}';
echo 'Modelo pronto.';
"
environment:
- AI_MODEL=${AI_MODEL:-llama3.2:3b}
restart: "no"
volumes:
mongo_data:
ollama_data: