- Removed the `analyze_data_file` function from tool definitions to streamline functionality. - Enhanced the `execute_python_code` function description to clarify auto-installation of packages and file handling. - Deleted the `python_executor.py` module to simplify the codebase and improve maintainability. - Introduced a new `token_counter.py` module for efficient token counting for OpenAI API requests, including support for Discord image links and cost estimation.
45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
bot:
|
|
image: ghcr.io/coder-vippro/chatgpt-discord-bot:latest
|
|
env_file:
|
|
- .env
|
|
restart: always
|
|
|
|
# Mount volumes for persistent data
|
|
volumes:
|
|
# Persistent file storage (optional - for permanent file storage)
|
|
- bot_files:/tmp/bot_code_interpreter/user_files
|
|
# Persistent venv cache (speeds up package installation)
|
|
- bot_venv:/tmp/bot_code_interpreter/venv
|
|
# Output directory (for generated files)
|
|
- bot_outputs:/tmp/bot_code_interpreter/outputs
|
|
|
|
# Resource limits (adjust based on your needs)
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '2.0'
|
|
memory: 2G
|
|
reservations:
|
|
cpus: '0.5'
|
|
memory: 512M
|
|
|
|
# Healthcheck
|
|
healthcheck:
|
|
test: ["CMD", "python3", "-c", "import sys; sys.exit(0)"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Define volumes for persistent data
|
|
volumes:
|
|
bot_files:
|
|
driver: local
|
|
bot_venv:
|
|
driver: local
|
|
bot_outputs:
|
|
driver: local
|