# Runs the bot together with a Lavalink v4 server for music playback. # docker compose up -d --build # build the bot image locally and start # services: bot: image: git.ksan.dev/ksan/botinator:latest build: . container_name: botinator restart: unless-stopped depends_on: - lavalink # BOT_TOKEN, GUILD_ID, LAVALINK_PASSWORD, ... come from .env. env_file: - .env environment: - LAVALINK_URI=ws://lavalink:2333 # Catchphrases and the AR-meter user lists are supplied at deploy time, # not baked into the image. volumes: - ./catchphrases.txt:/app/catchphrases.txt:ro - ./always100.txt:/app/always100.txt:ro - ./always90.txt:/app/always90.txt:ro lavalink: image: ghcr.io/lavalink-devs/lavalink:4 container_name: lavalink restart: unless-stopped # A mounted volume at /opt/Lavalink/plugins is created root-owned (the image # has no plugins dir for Docker to copy ownership from), but Lavalink runs as # a non-root user and can't write there. Run as root so it can download the # plugin jars into the volume. The container is internal-only. user: "0:0" env_file: - .env environment: - _JAVA_OPTIONS=-Xmx1G # Lavalink reads this for lavalink.server.password in application.yml. # Keep it equal to LAVALINK_PASSWORD (what the bot uses to connect). - LAVALINK_SERVER_PASSWORD=${LAVALINK_PASSWORD} volumes: - ./lavalink/application.yml:/opt/Lavalink/application.yml:ro # Named volume (managed by Docker) rather than a host bind mount. Docker # initializes it from the image, so it's owned by Lavalink's container user # and the plugin jars download without permission errors. No root-owned (or # UID-mismatched) plugins/ dir in the deploy directory. - lavalink-plugins:/opt/Lavalink/plugins ports: - "2333:2333" volumes: lavalink-plugins: