-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (111 loc) · 2.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
114 lines (111 loc) · 2.84 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
services:
ollama:
image: bd_ollama:latest
container_name: bd_ollama
build:
context: ./ollama
dockerfile: Dockerfile
ports:
- "${HOST_OLLAMA_PORT:-11434}:11434"
volumes:
- bd_ollama_data:/root/.ollama
environment:
- OLLAMA_KEEP_ALIVE=24h
- OLLAMA_HOST=0.0.0.0
restart: unless-stopped
networks:
bd_network:
ipv4_address: "172.28.0.10"
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: 10s
timeout: 5s
retries: 3
start_period: 1s
database:
image: postgres:16
restart: always
container_name: bd_database
ports:
- "${HOST_POSTGRES_PORT:-5432}:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
networks:
bd_network:
ipv4_address: "172.28.0.30"
volumes:
- bd_pgdata:/var/lib/postgresql/data
- ./database/seed.sql:/docker-entrypoint-initdb.d/seed.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
backend:
image: bd_backend:latest
container_name: bd_backend
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "${HOST_BACKEND_PORT:-8000}:8000"
environment:
- OLLAMA_BASE_URL=http://bd_ollama:11434
- POSTGRES_HOST=bd_database
- POSTGRES_PORT=5432
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
bd_network:
ipv4_address: "172.28.0.20"
depends_on:
database:
condition: service_healthy
ollama:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 1s
frontend:
tty: true
image: bd_frontend:latest
container_name: bd_frontend
build:
context: ./frontend
dockerfile: Dockerfile
environment:
- BACKEND_BASE_URL=http://bd_backend:8000
ports:
- "${HOST_FRONTEND_PORT:-3000}:3000"
networks:
bd_network:
ipv4_address: "172.28.0.40"
depends_on:
backend:
condition: service_healthy
ollama:
condition: service_healthy
database:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 10
start_period: 1s
volumes:
bd_ollama_data:
bd_pgdata:
networks:
bd_network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
gateway: 172.28.0.1