major-domo-v2/docker-compose.yml
Cal Corum 0c001b6dab Fix @requires_team decorator API error handling
The @requires_team() decorator was incorrectly treating API errors as "no team"
because get_user_team() was catching all exceptions and returning None.

Changes:
1. get_user_team() now propagates exceptions instead of catching them
   - Allows callers to distinguish between "no team found" vs "API error"
   - Updated docstring to document the exception behavior

2. @requires_team() decorator now has try-except block
   - Returns specific error for "no team" (None result)
   - Returns helpful error for API/network issues (exception caught)
   - Logs exceptions for debugging

3. league_admin_only() decorator enhanced
   - Now supports both slash commands (Interaction) and prefix commands (Context)
   - Unified error handling for both command types

4. team_service.py and related updates
   - Team model field name corrected: team_abbrev -> abbrev

This fixes the regression where /cc-create was failing with "no team" error
when it should have been showing an API error message or working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:31:14 -06:00

80 lines
1.8 KiB
YAML

version: '3.8'
# ============================================
# Production Configuration
# ============================================
# This compose file pulls the pre-built image from Docker Hub
#
# Usage:
# docker-compose pull
# docker-compose up -d
#
# Docker Hub Repository: manticorum67/major-domo-discordapp
services:
discord-bot:
# Build locally from Dockerfile
build:
context: .
dockerfile: Dockerfile
container_name: major-domo-discord-bot-v2
# Restart policy
restart: unless-stopped
# Environment variables from .env file
env_file:
- .env
# Environment configuration (uses .env file values)
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- ENVIRONMENT=${ENVIRONMENT:-production}
- TESTING=${TESTING:-false}
- REDIS_URL=${REDIS_URL:-}
- REDIS_CACHE_TTL=${REDIS_CACHE_TTL:-300}
# Volume mounts
volumes:
# Google Sheets credentials (required)
- ${SHEETS_CREDENTIALS_HOST_PATH:-./data}:/app/data:ro
# Logs directory (persistent) - mounted to /app/logs where the application expects it
- ${LOGS_HOST_PATH:-./logs}:/app/logs:rw
# Development volumes for local testing
- ../dev-logs:/app/dev-logs:rw
- ../dev-storage:/app/dev-storage:rw
# Network configuration
networks:
- major-domo-network
# Health check
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 60s
timeout: 10s
retries: 3
# Resource limits (production)
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
major-domo-network:
driver: bridge