-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (114 loc) · 3.18 KB
/
docker-compose.yml
File metadata and controls
126 lines (114 loc) · 3.18 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
services:
# Qdrant Vector Database
qdrant:
image: qdrant/qdrant:latest
container_name: invoice-qdrant
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
environment:
- QDRANT__SERVICE__HTTP_PORT=6333
- QDRANT__SERVICE__GRPC_PORT=6334
healthcheck:
test: ["CMD-SHELL", "find /proc -maxdepth 2 -name comm -exec grep -l qdrant {} + | head -1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- invoice-network
# FastAPI Backend
backend:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: invoice-backend
ports:
- "8000:8000"
environment:
# Application settings
- APP_NAME=Invoice Reimbursement System
- APP_VERSION=1.0.0
- DEBUG=false
- LOG_LEVEL=INFO
- ENVIRONMENT=development
# Security settings
- ALLOWED_HOSTS=localhost,127.0.0.1,backend,invoice-backend
# Qdrant configuration
- QDRANT_URL=http://qdrant:6333
- QDRANT_API_KEY=${QDRANT_API_KEY:-}
# Gemini API configuration
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
# Vector store configuration
- COLLECTION_NAME=invoice_reimbursements
- EMBEDDING_MODEL=all-MiniLM-L6-v2
- VECTOR_SIZE=384
# File upload configuration
- MAX_FILE_SIZE=50
- ALLOWED_EXTENSIONS=pdf,zip
- UPLOAD_DIRECTORY=uploads
# LLM configuration
- LLM_MODEL=gemini-2.5-flash
- LLM_TEMPERATURE=0.1
- MAX_TOKENS=4096
# Chat configuration
- MAX_CONVERSATION_HISTORY=10
# Cache directories for models
- HF_HOME=/app/.cache/huggingface
- TRANSFORMERS_CACHE=/app/.cache/transformers
- SENTENCE_TRANSFORMERS_HOME=/app/.cache/sentence-transformers
volumes:
- ./uploads:/app/uploads
- ./logs:/app/logs
- model_cache:/app/.cache
depends_on:
qdrant:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health/quick"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- invoice-network
restart: unless-stopped
# Streamlit Frontend
frontend:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: invoice-frontend
ports:
- "8501:8501"
environment:
- STREAMLIT_API_BASE_URL=http://backend:8000
- STREAMLIT_API_TIMEOUT=300
- STREAMLIT_DEFAULT_CURRENCY=INR
command: ["python", "-m", "streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true"]
volumes:
- ./uploads:/app/uploads
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- invoice-network
restart: unless-stopped
volumes:
qdrant_data:
driver: local
model_cache:
driver: local
networks:
invoice-network:
driver: bridge