This guide explains how to run Radon using Docker with support for both local development and production deployment with cloud services.
- Docker installed on your system
- Docker Compose installed on your system
- A Discord bot token (from Discord Developer Portal)
- For production: MongoDB Atlas and Redis Cloud accounts (recommended)
Perfect for Railway deployment or when using MongoDB Atlas + Redis Cloud:
# Copy the environment template
cp .env.example .envEdit .env with your cloud service credentials:
# Discord Bot Configuration
DISCORD_TOKEN=your_discord_bot_token
CLIENT_NAME=Radon
# MongoDB Atlas (Cloud Database)
MONGO=mongodb+srv://username:password@cluster.mongodb.net/radon?retryWrites=true&w=majority
# Redis Cloud (Cloud Cache)
REDIS_HOST=your-redis-cloud-host.com
REDIS_PORT=12345
REDIS_PASSWORD=your_redis_cloud_password
# Optional: Bot list tokens
TOP_BOT_TOKEN=your_top_gg_token
VOID_BOT_TOKEN=your_void_bots_token# Build and run the bot with cloud services
docker-compose up -d
# View logs
docker-compose logs -f radon-bot
# Stop the bot
docker-compose downFor development with cloud services using separate credentials:
# Copy the development environment template
cp .env.example .env.developmentEdit .env.development with your development cloud service credentials:
# Discord Bot Configuration
DISCORD_TOKEN=your_development_discord_bot_token
CLIENT_NAME=Radon-Dev
# MongoDB Atlas (Development Database)
MONGO=mongodb+srv://username:password@dev-cluster.mongodb.net/radon_dev?retryWrites=true&w=majority
# Redis Cloud (Development Cache)
REDIS_HOST=your-dev-redis-cloud-host.com
REDIS_PORT=12345
REDIS_PASSWORD=your_dev_redis_cloud_password# Build and run the development bot with cloud services
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f radon-bot-dev
# Stop the development bot
docker-compose -f docker-compose.dev.yml downRailway will automatically use the production stage from our multi-stage Dockerfile since it's positioned as the last stage. No additional configuration needed!
Create railway.toml for explicit control:
[build]
builder = "dockerfile"
dockerfilePath = "./Dockerfile"
[deploy]
restartPolicyType = "on-failure"Set these via Railway dashboard or CLI:
railway variables set DISCORD_TOKEN=your_token
railway variables set MONGO=your_mongodb_atlas_connection_string
railway variables set REDIS_HOST=your_redis_cloud_host
railway variables set REDIS_PASSWORD=your_redis_cloud_passwordOur Dockerfile uses a 3-stage build:
- Builder Stage: Compiles TypeScript and installs all dependencies
- Development Stage: For local development with hot reload
- Production Stage: Optimized final image with only runtime dependencies
Important: Railway and Docker use the last stage by default, which is our production stage.
- radon-bot: The main Discord bot using cloud services
- radon-bot-dev: Bot with hot reloading and development configuration using cloud services
Note: Both environments now use cloud services (MongoDB Atlas + Redis Cloud) with different credentials.
Both environments use cloud services:
- Production: Access your production databases through MongoDB Atlas and Redis Cloud dashboards
- Development: Access your development databases through MongoDB Atlas and Redis Cloud dashboards
# Build the Docker image
docker build -t radon-bot .
# Run just the bot (requires external MongoDB and Redis)
docker run -d --name radon-bot --env-file .env radon-bot
# Rebuild and restart services
docker-compose up --build -d# View bot logs
docker-compose logs -f radon-bot
# Execute commands inside the bot container
docker-compose exec radon-bot bun run typecheck
# Access bot container shell
docker-compose exec radon-bot sh
# Update Prisma client
docker-compose exec radon-bot bunx prisma generate
# Reset database (development only)
docker-compose -f docker-compose.dev.yml down -v
docker-compose -f docker-compose.dev.yml up -d# Scale the bot (if you need multiple instances)
docker-compose up -d --scale radon-bot=3| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
Yes | Your Discord bot token |
DEV_DISCORD_TOKEN |
No | Development bot token |
MONGO |
No | MongoDB connection string (auto-configured for Docker) |
DEV_MONGO |
No | Development MongoDB connection string |
REDIS_HOST |
No | Redis host (auto-configured for Docker) |
REDIS_PORT |
No | Redis port (default: 6379) |
REDIS_PASSWORD |
No | Redis password |
CLIENT_NAME |
No | Bot client name (default: Radon) |
TOP_BOT_TOKEN |
No | Top.gg API token for bot statistics |
VOID_BOT_TOKEN |
No | Void Bots API token for bot statistics |
Docker volumes are used to persist data:
mongodb-data: MongoDB database filesredis-data: Redis data files./logs: Application logs (mounted from host)
- Check that your Discord token is correct
- Verify environment variables in
.envfile - Check container logs:
docker-compose logs radon-bot
- Ensure MongoDB container is running:
docker-compose ps - Check MongoDB logs:
docker-compose logs mongodb - Verify database connection string in environment variables
- Ensure Redis container is running:
docker-compose ps - Check Redis logs:
docker-compose logs redis - Verify Redis configuration in environment variables
- Ensure the bot has proper Discord permissions
- Check that the bot is added to your Discord server
- Verify bot token is not expired
- Change default passwords in production
- Use Docker secrets for sensitive data in production
- Regularly update the base Docker images
- Monitor container resource usage
For additional help:
- Check the application logs
- Review Discord.js documentation
- Join the support Discord server (if available)
- Open an issue on the GitHub repository