-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (81 loc) · 2.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
85 lines (81 loc) · 2.17 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
services:
db:
image: postgres:15-alpine
container_name: medical_chatbot_db
environment:
POSTGRES_USER: medicalbot
POSTGRES_PASSWORD: medicalbot_password
POSTGRES_DB: medical_chatbot
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U medicalbot -d medical_chatbot"]
interval: 10s
timeout: 5s
retries: 5
networks:
- medical_chatbot_network
app:
build: .
container_name: medical_chatbot_app
ports:
- "8080:8080"
environment:
- DATABASE_URL=postgresql://medicalbot:medicalbot_password@db:5432/medical_chatbot
- PINECONE_API_KEY=${PINECONE_API_KEY}
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- SECRET_KEY=${SECRET_KEY}
- GEMINI_MODEL=${GEMINI_MODEL:-gemini-2.5-flash}
depends_on:
db:
condition: service_healthy
volumes:
- ./data/uploads:/app/data/uploads
- ./app.py:/app/app.py
- ./src:/app/src
- ./templates:/app/templates
- ./static:/app/static
- ./tests:/app/tests
networks:
- medical_chatbot_network
command: >
sh -c "
echo 'Waiting for database to be ready...' &&
until pg_isready -h db -U medicalbot -d medical_chatbot; do
echo 'Database not ready, waiting...'
sleep 2
done &&
echo 'Database is ready!' &&
python -c 'from app import app, db; app.app_context().push(); db.create_all()' &&
python app.py
"
test:
build: .
container_name: medical_chatbot_test
environment:
- DATABASE_URL=postgresql://medicalbot:medicalbot_password@db:5432/medical_chatbot_test
- PINECONE_API_KEY=${PINECONE_API_KEY}
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- SECRET_KEY=test-secret-key
depends_on:
db:
condition: service_healthy
volumes:
- ./:/app
networks:
- medical_chatbot_network
command: >
sh -c "
echo 'Waiting for database...' &&
sleep 5 &&
pytest -v
"
profiles:
- test
volumes:
postgres_data:
networks:
medical_chatbot_network:
driver: bridge