Set these in your Dokploy environment configuration:
# Required - Discord
TOKEN=your_discord_bot_token
CLIENT_ID=your_discord_client_id
# Required - Database
DATABASE_URL=postgresql://user:password@host:5432/dbname
# Required - AI Services
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key
# Optional
MODERATOR_ROLE_ID=
INDEXABLE_CHANNEL_IDS=
MOD_LOG_CHANNEL_ID=
NODE_ENV=productionMake sure your PostgreSQL database is accessible from the container.
- Create a new PostgreSQL instance in Dokploy
- Use the internal service name as host (e.g.,
database-echobot-xxxxx) - Set
DATABASE_URLlike:DATABASE_URL=postgresql://username:password@database-echobot-xxxxx:5432/echo
- Ensure your database accepts connections from Dokploy's IP
- Use the public IP/hostname and port
- Set
DATABASE_URLlike:DATABASE_URL=postgresql://username:password@your-db-host:5432/echo
Important: After deployment, run migrations:
bunx prisma migrate deploy
# or
bunx prisma db push-
Connect Your Repository
- In Dokploy, click "Create Application"
- Select "Docker" as the application type
- Connect your Git repository
- Select the branch to deploy (e.g.,
main)
-
Configure Build Settings
- Build Type: Dockerfile
- Dockerfile Path:
./Dockerfile(default) - Build Context:
.(root directory)
-
Set Environment Variables
- Go to the "Environment" tab
- Add all required variables:
TOKEN=your_discord_bot_token CLIENT_ID=your_discord_client_id DATABASE_URL=postgresql://user:password@host:5432/dbname OPENAI_API_KEY=your_openai_api_key TAVILY_API_KEY=your_tavily_api_key - Optional: Add
NODE_ENV=production(already set in Dockerfile)
-
Database Connection
- If using Dokploy's PostgreSQL service:
- Create a new PostgreSQL database in Dokploy
- Copy the connection string
- Use the internal service name in DATABASE_URL
- If using external database:
- Ensure database is accessible from Dokploy's network
- Use the external hostname/IP in DATABASE_URL
- If using Dokploy's PostgreSQL service:
-
Deploy
- Click "Deploy" button
- Monitor the build logs
- Wait for "✅ Echo is now online!" message in logs
-
Verify Deployment
- Check bot status in Discord (should show online)
- Review application logs in Dokploy
- Test bot commands in Discord
Build Fails
- Check that the repository is accessible
- Verify Dockerfile path is correct
- Review build logs for specific errors
Container Starts but Bot Doesn't Come Online
- Check application logs for error messages
- Verify all 5 required environment variables are set
- Ensure DATABASE_URL can connect from within the container
- Validate Discord TOKEN is not expired
Database Connection Issues
- If using Dokploy PostgreSQL: Use internal service name (e.g.,
postgres-echo-xxxxx:5432) - If using external DB: Ensure firewall allows Dokploy's IP
- Test DATABASE_URL format:
postgresql://user:password@host:5432/database - Check database exists and user has proper permissions
"Missing required environment variables" Error
- Go to Dokploy Environment tab
- Verify all 5 required vars are set:
- TOKEN
- CLIENT_ID
- DATABASE_URL
- OPENAI_API_KEY
- TAVILY_API_KEY
- Click "Redeploy" after adding variables
Health Check Failures
- The bot has a 60-second startup grace period
- If failing after startup, check bot logs for crashes
- Verify the bot process is running (health check looks for Bun process)
- Go to your application in Dokploy
- Click "Logs" tab
- Look for startup messages:
🦊 Echo Bot Container Starting✅ All required environment variables are set✅ Migrations applied successfully✅ Echo is now online!
If the bot doesn't come online:
- Check logs in Dokploy console
- Verify
DATABASE_URLis set correctly - Ensure Discord token has proper permissions
- Check that all required environment variables are set
The container includes a health check that verifies Bun is running. Dokploy will automatically restart if health check fails.