Files
discord-docker-bot/README.md
2026-03-28 17:47:46 +00:00

140 lines
3.8 KiB
Markdown

# 🐳 Discord Docker Monitor Bot
[![Docker Pulls](https://img.shields.io/docker/pulls/survivalful/discord-docker-bot)](https://hub.docker.com/r/survivalful/discord-docker-bot)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Docker Image Size](https://img.shields.io/docker/image-size/survivalful/discord-docker-bot/latest)](https://hub.docker.com/r/survivalful/discord-docker-bot)
Monitor your Docker containers directly from Discord — automatic status updates every 30 seconds, grouped by project, with read-only channels for your team.
raw https://git.survivalful.de/Survivalful/discord-docker-bot/src/branch/main/bild.png
---
## ✨ Features
- 📋 List all Docker containers on your host
- 📁 Group containers with dedicated Discord channels
- 🔄 Automatic status updates every 30 seconds
- 🟢 Live status indicators (running, exited, paused, created)
- 🔒 Read-only channels for regular users
---
## 🚀 Quick Start
**Option A — Docker Run (fastest)**
```bash
docker run -d \
--restart unless-stopped \
-e BOT_TOKEN=your_token \
-e DOCKER_HOST=tcp://your-host:2375 \
-e GUILD_ID=your_guild_id \
-e CATEGORY_NAME="Docker Status" \
survivalful/discord-docker-bot:latest
```
**Option B — Docker Compose (recommended)**
1. Create your `.env` file:
```env
BOT_TOKEN=your_discord_bot_token
DOCKER_HOST=tcp://your-docker-host:2375
GUILD_ID=your_discord_server_id
CATEGORY_NAME=Docker Status
```
2. Create your `docker-compose.yml`:
```yaml
services:
discord-bot:
image: survivalful/discord-docker-bot:latest
restart: unless-stopped
env_file:
- .env
```
3. Start it:
```bash
docker compose up -d
```
That's it! 🎉
---
## 🤖 Commands
| Command | Description |
|---|---|
| `!info` | Shows all available commands |
| `!container_list` | Lists all containers on the host |
| `!group_create <name> <container1> ...` | Creates a group with a dedicated channel |
| `!group_remove <name>` | Deletes a group and its channel |
| `!group_list` | Shows all existing groups |
---
## 📊 Status Indicators
| Symbol | Status |
|---|---|
| 🟢 | Running |
| 🔴 | Exited |
| 🟡 | Paused |
| ⚪ | Created |
| ❓ | Unknown |
---
## ⚙️ Requirements
- Docker & Docker Compose on the host
- Docker remote API enabled (`tcp://host:2375`)
- A Discord Bot Token ([create one here](https://discord.com/developers/applications))
---
## ⚠️ Security Warning
Port `2375` is **unencrypted and unauthenticated**. Anyone with network access to that port can control your Docker daemon.
**Recommendations:**
- Use a firewall to restrict access to port 2375
- Only expose it on a trusted local network
- Consider using Docker socket proxy as a safer alternative
- Never expose port 2375 to the public internet
---
## 🛠️ Troubleshooting
**Bot starts but no channels are created**
→ Check that `GUILD_ID` is correct and the bot has `Manage Channels` permission.
**"Cannot connect to Docker"**
→ Make sure the Docker remote API is enabled and `DOCKER_HOST` points to the right address.
**Status stops updating**
→ Restart the container: `docker compose restart`
**Bot is offline in Discord**
→ Check your `BOT_TOKEN` and verify the bot is still in your server.
---
## 🤝 Contributing
Contributions are welcome! Open an issue or submit a pull request on the [Git repository](https://git.survivalful.de/Survivalful/discord-docker-bot).
---
## 📄 License
Licensed under [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0) — free to use, modify and distribute, but changes must stay open-source.
---
## 🛠️ Support
- 📧 [team@survivalful.de](mailto:team@survivalful.de)
- 🐙 [git.survivalful.de/Survivalful/discord-docker-bot](https://git.survivalful.de/Survivalful/discord-docker-bot)