- Deleted .env.example file as it is no longer needed. - Added .gitignore to manage ignored files and directories. - Introduced CLAUDE.md for AI provider integration documentation. - Created dev.sh for development setup and scripts. - Updated Dockerfile and Dockerfile.production for improved build processes. - Added multiple test files and directories for comprehensive testing. - Introduced new utility and service files for enhanced functionality. - Organized codebase with new directories and files for better maintainability.
156 lines
4.1 KiB
YAML
156 lines
4.1 KiB
YAML
services:
|
|
# Discord Bot - Development Mode
|
|
bot:
|
|
build:
|
|
context: .
|
|
target: development
|
|
container_name: disbord-bot
|
|
environment:
|
|
- POSTGRES_URL=postgresql://quotes_user:secure_password@postgres:5432/quotes_db
|
|
- REDIS_URL=redis://redis:6379
|
|
- QDRANT_URL=http://qdrant:6333
|
|
- PROMETHEUS_PORT=8080
|
|
- PYTHONPATH=/app
|
|
- PYTHONUNBUFFERED=1
|
|
- WATCHDOG_ENABLED=true
|
|
env_file: .env
|
|
depends_on:
|
|
postgres: { condition: service_healthy }
|
|
redis: { condition: service_healthy }
|
|
qdrant: { condition: service_healthy }
|
|
volumes:
|
|
- ./:/app
|
|
- /app/data
|
|
- /app/logs
|
|
- /app/__pycache__
|
|
- ./data:/app/data
|
|
- ./logs:/app/logs
|
|
- ./temp:/app/temp
|
|
- ./config:/app/config
|
|
ports:
|
|
- "38080:8080"
|
|
- "5678:5678"
|
|
restart: "no"
|
|
stdin_open: true
|
|
tty: true
|
|
# NVIDIA GPU support and proper memory settings
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|
|
ipc: host
|
|
ulimits:
|
|
memlock: -1
|
|
stack: 67108864
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: disbord-postgres
|
|
environment:
|
|
- POSTGRES_DB=quotes_db
|
|
- POSTGRES_USER=quotes_user
|
|
- POSTGRES_PASSWORD=secure_password
|
|
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
|
|
ports: ["35432:5432"]
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U quotes_user -d quotes_db"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
# Redis Cache
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: disbord-redis
|
|
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes
|
|
volumes: [redis_data:/data]
|
|
ports: ["36379:6379"]
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 2s
|
|
retries: 3
|
|
|
|
# Vector Database
|
|
qdrant:
|
|
image: qdrant/qdrant:latest
|
|
container_name: disbord-qdrant
|
|
ports: ["36333:6333", "36334:6334"]
|
|
volumes: [qdrant_data:/qdrant/storage]
|
|
environment:
|
|
- QDRANT__SERVICE__HTTP_PORT=6333
|
|
- QDRANT__SERVICE__GRPC_PORT=6334
|
|
- QDRANT__LOG_LEVEL=INFO
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:6333/ || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
# Monitoring Stack (Optional - use profiles to disable)
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: disbord-prometheus
|
|
ports: ["9090:9090"]
|
|
volumes:
|
|
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- prometheus_data:/prometheus
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
- '--storage.tsdb.retention.time=7d'
|
|
- '--web.enable-lifecycle'
|
|
restart: unless-stopped
|
|
profiles: [monitoring]
|
|
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: disbord-grafana
|
|
ports: ["3080:3000"]
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./config/grafana:/etc/grafana/provisioning:ro
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
depends_on: [prometheus]
|
|
restart: unless-stopped
|
|
profiles: [monitoring]
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
driver_opts: { type: none, o: bind, device: ./data/postgres }
|
|
redis_data:
|
|
driver: local
|
|
driver_opts: { type: none, o: bind, device: ./data/redis }
|
|
qdrant_data:
|
|
driver: local
|
|
driver_opts: { type: none, o: bind, device: ./data/qdrant }
|
|
prometheus_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
networks:
|
|
default:
|
|
name: disbord-dev
|
|
driver: bridge |