Skip to content

Commit 1972dd6

Browse files
committed
config: add docker-compose production override
- Use GHCR image for production deployments - Configure production environment variables - Set higher confidence threshold (0.8) for production - Enable replicated mode with configurable replicas - Set production resource limits (32GB memory) - Configure rolling update and rollback policies - Add JSON logging with rotation
1 parent dcb09d2 commit 1972dd6

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

docker-compose.prod.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Arctic Text2SQL Agent - Production Environment Override
2+
#
3+
# Usage: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
4+
#
5+
# This file overrides the base docker-compose.yml for production deployments.
6+
7+
services:
8+
api:
9+
image: ghcr.io/sakeeb91/arctic-text2sql-agent:${IMAGE_TAG:-latest}
10+
build: !reset null
11+
environment:
12+
# Database
13+
- DATABASE_URL=${DATABASE_URL}
14+
# HuggingFace
15+
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
16+
- TEXT2SQL_MODEL=${TEXT2SQL_MODEL:-Snowflake/Arctic-Text2SQL-R1-7B}
17+
- MODEL_DEVICE=${MODEL_DEVICE:-cuda}
18+
# API - Production settings
19+
- API_HOST=0.0.0.0
20+
- API_PORT=8000
21+
- API_DEBUG=false
22+
- CORS_ORIGINS=${CORS_ORIGINS}
23+
# Agent
24+
- AGENT_MAX_STEPS=${AGENT_MAX_STEPS:-5}
25+
- AGENT_MIN_CONFIDENCE=${AGENT_MIN_CONFIDENCE:-0.8}
26+
- AGENT_VERBOSITY=0
27+
# Logging
28+
- LOG_LEVEL=INFO
29+
- LOG_FORMAT=json
30+
# Cache
31+
- REDIS_URL=redis://redis:6379/0
32+
# Security
33+
- SECRET_KEY=${SECRET_KEY}
34+
# Rate Limiting
35+
- RATE_LIMIT_REQUESTS=${RATE_LIMIT_REQUESTS:-100}
36+
- RATE_LIMIT_WINDOW=${RATE_LIMIT_WINDOW:-60}
37+
volumes:
38+
# Production: no source mounts, only data volumes
39+
- app-data:/app/data
40+
- huggingface-cache:/home/appuser/.cache/huggingface
41+
deploy:
42+
mode: replicated
43+
replicas: ${REPLICAS:-2}
44+
resources:
45+
limits:
46+
memory: 32G
47+
reservations:
48+
memory: 16G
49+
update_config:
50+
parallelism: 1
51+
delay: 30s
52+
failure_action: rollback
53+
order: start-first
54+
rollback_config:
55+
parallelism: 1
56+
delay: 10s
57+
restart_policy:
58+
condition: any
59+
delay: 5s
60+
max_attempts: 3
61+
window: 120s
62+
labels:
63+
- "environment=production"
64+
- "version=${IMAGE_TAG:-latest}"
65+
logging:
66+
driver: json-file
67+
options:
68+
max-size: "100m"
69+
max-file: "5"
70+
71+
db:
72+
environment:
73+
POSTGRES_USER: ${POSTGRES_USER}
74+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
75+
POSTGRES_DB: ${POSTGRES_DB:-text2sql_prod}
76+
deploy:
77+
resources:
78+
limits:
79+
memory: 4G
80+
reservations:
81+
memory: 2G
82+
labels:
83+
- "environment=production"
84+
logging:
85+
driver: json-file
86+
options:
87+
max-size: "50m"
88+
max-file: "3"
89+
90+
redis:
91+
deploy:
92+
resources:
93+
limits:
94+
memory: 1G
95+
reservations:
96+
memory: 512M
97+
labels:
98+
- "environment=production"
99+
logging:
100+
driver: json-file
101+
options:
102+
max-size: "20m"
103+
max-file: "3"

0 commit comments

Comments
 (0)