Prerequisites
Before you begin, ensure you have the following installed:- Docker (version 20.10 or newer)
- Docker Compose (version 2.0 or newer)
- Discord Bot Token (Create a bot)
- ImgBB API Key (Get your key)
Quick Start
Create environment configuration
Copy the example environment file and configure your credentials:Edit
.env and add your tokens:.env
Start the bot
Launch the bot using Docker Compose:The bot will:
- Build the Docker image from the Dockerfile
- Create a persistent volume for the database
- Run database migrations automatically
- Start the bot in detached mode
Docker Configuration
Dockerfile Overview
The Dockerfile uses a multi-stage build for optimal image size:Docker Compose Configurations
Volume Persistence
The bot uses a volume mount to persist the SQLite database across container restarts:Database Location: The database file is stored at
./data/database.sqlite on your host machine and mounted to /app/data/database.sqlite inside the container.- User tracking data persists across container restarts
- Profile picture history is preserved
- Database migrations are applied correctly
Production Deployment
For production environments, use the production Docker Compose configuration:Production Features
Pre-built Images
Uses the official image from GitHub Container Registry instead of building locally
Auto-updates
Watchtower automatically checks for and deploys new versions every 5 minutes
Auto-restart
Containers automatically restart on failure or system reboot
Security
Watchtower runs with security restrictions (no-new-privileges)
Managing the Container
View Logs
Stop the Bot
Restart the Bot
Updating the Container
- With Watchtower (Production)
- Manual Update (Development)
- Manual Update (Production)
If you’re using the production configuration with Watchtower, updates are automatic:
- Watchtower checks for new images every 5 minutes (300 seconds)
- When a new version is detected, it automatically pulls and restarts the container
- Your data is preserved during updates
Check Watchtower logs to see update activity:
Troubleshooting
Container exits immediately
Container exits immediately
Check the logs for configuration errors:Common issues:
- Invalid Discord token or ImgBB API key
- Missing
.envfile - Database connection errors
Database not persisting
Database not persisting
Ensure the volume mount is correct:
Permission errors on data directory
Permission errors on data directory
Fix permissions on the data directory:
Watchtower not updating
Watchtower not updating
Check Watchtower logs and ensure it has Docker socket access:
Next Steps
Configuration
Learn about all available environment variables and configuration options
Manual Installation
Prefer to run without Docker? Check out the manual installation guide