Add Docker and Compose setup for Discord bot deployment
Introduce Dockerfile for containerizing the Discord bot, including required dependencies for audio handling. Add compose.yaml for simplified service orchestration. Update .gitignore to exclude compiled files and environment-specific artifacts.
This commit is contained in:
1 parent
514df72a03
commit
78cacc3a17
4 files changed
+41
No files matched your search
@@ -1 +1,5 @@
|
||||
.env
|
||||
__pycache__/
|
||||
*.pyc
|
||||
downloads/
|
||||
.DS_Store
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
FROM python:3.13-slim
|
||||
|
||||
# Install system dependencies including opus and ffmpeg
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libopus0 \
|
||||
libopus-dev \
|
||||
ffmpeg \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements first to leverage Docker cache
|
||||
COPY requirements.txt .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
|
||||
# Command to run the bot
|
||||
CMD ["python", "main.py"]
|
||||
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
discord-bot:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: vibe-bot
|
||||
environment:
|
||||
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,4 @@
|
||||
discord.py[voice]
|
||||
python-dotenv
|
||||
yt-dlp
|
||||
PyNaCl
|
||||
Reference in new issue
Block a user