https://github.com/rodigrorodrigues/discord-docker-bot
Discord bot developed to control Docker containers through simple Discord commands.
https://github.com/rodigrorodrigues/discord-docker-bot
bot discord discord-bot docker docker-container python
Last synced: 3 months ago
JSON representation
Discord bot developed to control Docker containers through simple Discord commands.
- Host: GitHub
- URL: https://github.com/rodigrorodrigues/discord-docker-bot
- Owner: rodigrorodrigues
- Created: 2025-03-26T21:02:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T21:05:29.000Z (over 1 year ago)
- Last Synced: 2025-03-26T22:23:10.247Z (over 1 year ago)
- Topics: bot, discord, discord-bot, docker, docker-container, python
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord Docker Bot
## ๐ Description
Discord bot developed to control Docker containers through simple Discord commands.
## ๐ ๏ธ Technologies Used
- Python 3.9
- discord.py
- Docker SDK for Python
- python-dotenv
## ๐ Features
- Start container (`!start`)
- Stop container (`!stop`)
- Automatic event and error logging
## โ๏ธ Setup
### Prerequisites
- Python 3.9 or higher
- Docker installed
- A registered Discord application to obtain the token
### Environment Variables
Create an `.env` file in the project root with:
```env
DISCORD_TOKEN=your_discord_token
DOCKER_IMAGE=docker/image
DOCKER_CONTAINER_NAME=containerName
```
### Installation
1. Clone the repository:
```bash
git clone https://github.com/rodigrorodrigues/discord-docker-bot.git
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Run the bot:
```bash
python src/bot.py
```
### Using Docker Compose
To run using Docker Compose:
```bash
docker-compose up --build
```
## ๐ Bot Commands
- `!start` - Starts the container
- `!stop` - Stops the container
## ๐งช Tests
To run the tests:
```bash
python -m unittest tests/test_docker_service.py
```
## ๐ License
This project is under the MIT license.