Orpheus is a Discord music bot built with discord.py voice, yt-dlp, and Spotify Web API calls.
- Python 3.14 or higher
- FFmpeg available on your system path
- Discord and Spotify API credentials in a local
.envfile - Docker with Docker Compose support (optional)
kubectlif you want to deploy the bot to Kubernetes
Create a local .env file with:
DISCORD_TOKENSPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRET
For local development:
- Create and activate a virtual environment.
- Install dependencies with
pip install -r requirements.txt. - Start the bot with
python bot.py.
For Docker:
- Build and start the bot in the foreground with
docker compose up --build. - Build and start the bot in the background with
docker compose up -d --build. - Follow logs with
docker compose logs -f. - Stop the service with
docker compose down.
For Docker updates:
- Rebuild after dependency or Dockerfile changes with
docker compose up --build. - Restart after Python source changes with
docker compose restart.
The included Docker setup:
- uses
python:3.14-slimas the base image - installs
ffmpeginside the container - loads credentials from
.envthroughdocker-compose.yml - sets
PYTHONUNBUFFERED=1so debug output appears immediately in container logs - bind-mounts
bot.pyandsrc/into/appfor faster local development
For Kubernetes with Docker Desktop:
- Enable Kubernetes in Docker Desktop and wait for the cluster to become active.
- Confirm your context is
docker-desktopwithkubectl config current-context. - Build the bot image with
docker build -t orpheus:latest .. - Create the namespace with
kubectl apply -f k8s/namespace.yaml. - Create the Kubernetes secret from the local
.envfile withkubectl create secret generic orpheus-secrets --from-env-file=.env -n orpheus. - Apply the Deployment with
kubectl apply -f k8s/deployment.yaml. - Check resources with
kubectl get all -n orpheus. - Follow bot logs with
kubectl logs -f -n orpheus deployment/orpheus-bot.
To update the Kubernetes deployment after changing the bot code:
- Rebuild the image with
docker build -t orpheus:latest .. - Restart the Deployment with
kubectl rollout restart deployment/orpheus-bot -n orpheus. - Follow the new pod logs with
kubectl logs -f -n orpheus deployment/orpheus-bot.
The included Kubernetes setup:
- uses
k8s/namespace.yamlto isolate bot resources in theorpheusnamespace - uses
k8s/deployment.yamlto run a single bot replica from theorpheus:latestimage - reads
DISCORD_TOKEN,SPOTIFY_CLIENT_ID, andSPOTIFY_CLIENT_SECRETfrom theorpheus-secretsKubernetes Secret - includes
k8s/secret.example.yamlas a safe template for the required Secret keys - keeps Python logs unbuffered by setting
PYTHONUNBUFFERED=1
- Playback uses
discord.pyvoice,yt-dlp, and Spotify Web API calls. - Lavalink, Java, and OpenJDK are no longer required for this project.
.envis intentionally excluded from Docker build context through.dockerignore.- Run only one copy of the bot at a time. Stop the Docker Compose container before starting the Kubernetes Deployment with the same Discord token.