Spaces:
Runtime error
Runtime error
File size: 1,859 Bytes
330b6e4 |
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 |
version: '3.8'
services:
# Main chat agent application
chat-agent:
build: .
ports:
- "5000:5000"
environment:
- FLASK_ENV=production
- DATABASE_URL=postgresql://chatuser:chatpass@postgres:5432/chat_agent_db
- REDIS_URL=redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./logs:/app/logs
restart: unless-stopped
networks:
- chat-network
# PostgreSQL database
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: chat_agent_db
POSTGRES_USER: chatuser
POSTGRES_PASSWORD: chatpass
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chatuser -d chat_agent_db"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- chat-network
# Redis for caching and sessions
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- chat-network
# Nginx reverse proxy (optional, for production)
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- chat-agent
restart: unless-stopped
networks:
- chat-network
profiles:
- production
volumes:
postgres_data:
redis_data:
networks:
chat-network:
driver: bridge |