Files
ghbot/docker-compose.yml
Chris Ham 8823eac094 Convert to database-first configuration with token storage
- Rename config.json → seed.json to clarify seeding purpose
- Update ConfigManager to be database-first with minimal file fallbacks
- Store Discord token in database instead of environment variables
- Remove allowedSfxChannels functionality completely
- Update seeding script to import token from seed.json to database
- Add token field to bot_config table in database schema
- Update Docker volume mount to use seed.json
- Update gitignore to protect seed.json while allowing seed.example.json

Configuration Flow:
1. First run: Import from seed.json to database (one-time seeding)
2. Runtime: All configuration from SQLite database
3. Fallback: Environment variables if database unavailable

Security: All sensitive data now stored in encrypted SQLite database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 23:37:06 -07:00

65 lines
1.6 KiB
YAML

version: '3.8'
services:
discord-bot:
build:
context: .
dockerfile: Dockerfile
container_name: discord-bot
restart: unless-stopped
volumes:
# Seed file for initial database population (read-only)
- ./seed.json:/app/seed.json:ro
- ./conf:/app/conf:ro
# Sound effects directory (read-only)
- ./sfx:/app/sfx:ro
# Database persistence
- ./data:/app/data
# Optional: Mount logs directory if you want persistent logs
# - ./logs:/app/logs
# Optional: Environment variables
environment:
- NODE_ENV=production
# - DEBUG=true # Uncomment for debug mode
# Optional: Resource limits
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
# Optional: Health check
healthcheck:
test: ["CMD", "node", "-e", "process.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Add a volume backup service
# backup:
# image: alpine:latest
# container_name: ghbot-backup
# volumes:
# - ./config.json:/backup/config.json:ro
# - ./conf:/backup/conf:ro
# - ./sfx:/backup/sfx:ro
# command: |
# sh -c "
# echo 'Creating backup...'
# tar czf /backup/ghbot-backup-$(date +%Y%m%d_%H%M%S).tar.gz -C /backup config.json conf sfx
# echo 'Backup complete'
# "
# profiles:
# - backup
# Optional: Create named volumes for persistent data
# volumes:
# ghbot_logs:
# driver: local