build(docker): Add Docker Compose and Lavalink Configuration
This commit is contained in:
46
compose.yml
Normal file
46
compose.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
# docker-compose.yml
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# The Rust Discord Bot Service
|
||||
app:
|
||||
# Build the image from the Dockerfile in the current directory (.)
|
||||
build: .
|
||||
container_name: discord-bot-app
|
||||
restart: unless-stopped
|
||||
# Pass environment variables from the .env file
|
||||
env_file:
|
||||
- .env
|
||||
# Depend on the lavalink service to ensure it starts first (best practice)
|
||||
depends_on:
|
||||
- lavalink
|
||||
|
||||
# The LavaLink Service
|
||||
lavalink:
|
||||
# Use a Java Runtime Environment image (Alpine base for smaller size)
|
||||
image: eclipse-temurin:17-jre-alpine
|
||||
container_name: lavalink-server
|
||||
restart: unless-stopped
|
||||
# Set the working directory inside the container
|
||||
working_dir: /opt/lavalink
|
||||
# Mount the local Lavalink.jar and application.yml into the container
|
||||
volumes:
|
||||
- ./Lavalink.jar:/opt/lavalink/Lavalink.jar:ro # Mount Jar read-only
|
||||
- ./application.yml:/opt/lavalink/application.yml:ro # Mount config read-only
|
||||
- ./logs:/opt/lavalink/logs # Mount logs directory (optional)
|
||||
# Expose the LavaLink port to the host machine (optional, but useful for debugging)
|
||||
# and makes it reachable by the 'app' service via Docker network.
|
||||
ports:
|
||||
- "2333:2333"
|
||||
# Command to run LavaLink inside the container
|
||||
command: ["java", "-jar", "Lavalink.jar"]
|
||||
|
||||
# Define networks (optional, Docker Compose creates a default one)
|
||||
# networks:
|
||||
# default:
|
||||
# driver: bridge
|
||||
|
||||
# Define volumes (optional, if you need persistent data beyond logs)
|
||||
# volumes:
|
||||
# lavalink_logs:
|
||||
Reference in New Issue
Block a user