Files
Inanis_Vault/21-Server Reference/stacks/melodix.md

59 lines
2.4 KiB
Markdown

# Melodix
Discord music bot. Plays audio in Discord voice channels.
## Access
Internal only — no web UI, no exposed ports. Controlled via Discord commands.
## Containers
| Container | Image | Role |
|---|---|---|
| `melodix` | `melodix-image` (local build) | Discord bot |
No Tailscale sidecar. The bot connects outbound to Discord's API.
## Compose File
**Path:** `/home/artanis/DockerFiles/melodix/melodix/docker/docker-compose.yml`
```yaml
services:
melodix:
container_name: melodix
restart: always
image: '${ALIAS}-image'
volumes:
- ./data/datastore.json:/usr/project/datastore.json
- ./data/cache:/usr/project/cache
environment:
- DISCORD_TOKEN=${DISCORD_TOKEN}
- ENCODE_VOLUME=${ENCODE_VOLUME}
- ENCODE_CHANNELS=${ENCODE_CHANNELS}
- ENCODE_FRAME_RATE=${ENCODE_FRAME_RATE}
- ENCODE_FRAME_DURATION=${ENCODE_FRAME_DURATION}
- ENCODE_BITRATE=${ENCODE_BITRATE}
- ENCODE_COMPRESSION_LEVEL=${ENCODE_COMPRESSION_LEVEL}
- ENCODE_PACKET_LOSS=${ENCODE_PACKET_LOSS}
- ENCODE_BUFFERED_FRAMES=${ENCODE_BUFFERED_FRAMES}
- ENCODE_VBR=${ENCODE_VBR}
- ENCODE_VOLUME_FLOAT=${ENCODE_VOLUME_FLOAT}
- ENCODE_RECONNECT_AT_EOF=${ENCODE_RECONNECT_AT_EOF}
- ENCODE_RECONNECT_STREAMED=${ENCODE_RECONNECT_STREAMED}
- ENCODE_RECONNECT_ON_NETWORK_ERROR=${ENCODE_RECONNECT_ON_NETWORK_ERROR}
- ENCODE_RECONNECT_ON_HTTP_ERROR=${ENCODE_RECONNECT_ON_HTTP_ERROR}
- ENCODE_RECONNECT_DELAY_MAX=${ENCODE_RECONNECT_DELAY_MAX}
- ENCODE_FFMPEG_BINARY_PATH=${ENCODE_FFMPEG_BINARY_PATH}
- ENCODE_ENCODING_LINE_LOG=${ENCODE_ENCODING_LINE_LOG}
- ENCODE_USER_AGENT=${ENCODE_USER_AGENT}
- ENCODE_RAW_OUTPUT=${ENCODE_RAW_OUTPUT}
entrypoint: /usr/project/app
```
## Notes
- The image is built locally (`melodix-image`) — the build context and Dockerfile are in the parent directory of the compose file
- All configuration comes from the `.env` file at `/home/artanis/DockerFiles/melodix/melodix/docker/.env`
- `DISCORD_TOKEN` is the bot's Discord API token (in `.env`, redacted here)
- The `ENCODE_*` variables control FFmpeg audio encoding settings for the voice stream
- Data is stored via **relative bind mounts** (`./data/`) relative to the compose file directory — so at `/home/artanis/DockerFiles/melodix/melodix/docker/data/`
- Dockhand shows this stack under the name `docker` (the stack name is derived from the compose working directory name)