-
-
Notifications
You must be signed in to change notification settings - Fork 4
Hosting the Discord bot
LeNDuyA edited this page Nov 19, 2025
·
3 revisions
- Docker Desktop installed and running
- cloud
- I'm using fly.io
- Flyctl CLI installed
- fly.io account created and authenticated
- build the fat
jarlocally
./gradlew :bot:discord:fatJar- test the fat
jar
# Test it runs (will fail on missing env vars - that's expected)
java -jar bot/discord/build/libs/discord-bot-all.jar- test the Docker build locally
# Build Docker image
docker build -t discord-bot:test .
# Test run (will fail on missing env vars - that's expected)
docker run --rm discord-bot:test
# View local images
docker images- edit the
fly.tomlif needed - set environment variables
# Set Discord bot token as secret
flyctl secrets set discordBotApiKey=YOUR_DISCORD_TOKEN
# View all secrets (values are hidden)
flyctl secrets list- set up SSH access
# Check for existing SSH keys
ls ~/.ssh/id_*.pub
# If none exist, create one
ssh-keygen -t ed25519 -C "your_email@example.com"
# Add SSH key to fly.io
flyctl ssh issue --agent- deploy
# Deploy the bot
flyctl deploy
# If machines exist from failed deploys, destroy them first:
flyctl machines list
flyctl machines destroy <machine-id>- create the configuration
# SSH into the machine
flyctl ssh console
# Create config.json at the mounted volume location
cat > /app/res/config.json << 'EOF'
{
"featureList": [
{
"name": "Infil Glossary",
"isEnabled": true,
"supportedGames": []
},
{
"name": "Wavu Wiki",
"isEnabled": true,
"supportedGames": [
"Tekken_8"
]
},
{
"name": "SuperCombo Wiki",
"isEnabled": true,
"supportedGames": [
"Street_Fighter_6"
]
}
]
}
EOF- verify
# Check app status
flyctl status
# View logs
flyctl logs
# View live logs (follow mode)
flyctl logs -f
# List machines
flyctl machines list# Restart the app
flyctl apps restart fightingnerd
# SSH into machine
flyctl ssh console
# Start stopped machine
flyctl machine start <machine-id>
# Stop running machine
flyctl machine stop <machine-id>
# Destroy machine
flyctl machines destroy <machine-id>
# View app info
flyctl info