-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (120 loc) · 3.21 KB
/
docker-compose.yml
File metadata and controls
127 lines (120 loc) · 3.21 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
127
services:
postgres:
container_name: ifinho-postgres
image: pgvector/pgvector:pg18
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ifinho-postgres-data:/var/lib/postgresql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ifinho-network
ollama:
container_name: ifinho-ollama
image: ollama/ollama
restart: unless-stopped
volumes:
- ifinho-ollama-data:/root/.ollama
ports:
- "11434:11434"
networks:
- ifinho-network
ollama-init:
container_name: ifinho-ollama-init
image: ollama/ollama
profiles:
- prod
entrypoint: ["/bin/sh", "-c"]
command:
- |
echo "Waiting for Ollama to be ready..."
until ollama list > /dev/null 2>&1; do
sleep 2
done
echo "Pulling model: ${OLLAMA_MODEL:-llama3.2}"
ollama pull ${OLLAMA_MODEL:-llama3.2}
echo "Pulling embed model: ${OLLAMA_EMBED_MODEL:-nomic-embed-text}"
ollama pull ${OLLAMA_EMBED_MODEL:-nomic-embed-text}
echo "Models ready."
environment:
OLLAMA_HOST: http://ifinho-ollama:11434
depends_on:
- ollama
networks:
- ifinho-network
restart: "no"
server:
container_name: ifinho-server
build:
context: .
dockerfile: apps/server/Dockerfile
profiles:
- prod
restart: unless-stopped
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@ifinho-postgres:5432/${POSTGRES_DB}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost}
OLLAMA_BASE_URL: http://ifinho-ollama:11434
OLLAMA_MODEL: ${OLLAMA_MODEL:-llama3.2}
OLLAMA_EMBED_MODEL: ${OLLAMA_EMBED_MODEL:-nomic-embed-text}
NODE_ENV: production
depends_on:
postgres:
condition: service_healthy
ollama-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/ || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- ifinho-network
worker:
container_name: ifinho-worker
build:
context: .
dockerfile: apps/worker/Dockerfile
profiles:
- prod
restart: unless-stopped
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@ifinho-postgres:5432/${POSTGRES_DB}
OLLAMA_BASE_URL: http://ifinho-ollama:11434
OLLAMA_EMBED_MODEL: ${OLLAMA_EMBED_MODEL:-nomic-embed-text}
NODE_ENV: production
depends_on:
server:
condition: service_healthy
networks:
- ifinho-network
web:
container_name: ifinho-web
build:
context: .
dockerfile: apps/web/Dockerfile
args:
VITE_SERVER_URL: ${VITE_SERVER_URL:-http://localhost:3000}
profiles:
- prod
restart: unless-stopped
depends_on:
- server
networks:
- ifinho-network
volumes:
ifinho-postgres-data:
ifinho-ollama-data:
networks:
ifinho-network:
driver: bridge