fix(docker): robust jar glob, lavalink healthcheck + startup order, restrict 2333 to loopback

- COPY build/libs/*.jar instead of hardcoded discord-bot-1.0.0.jar (breaks on version bump)
- lavalink: add /v4/info healthcheck; bot waits for service_healthy before start;
  lavalink now depends on spotify-tokener
- lavalink host port bound to 127.0.0.1 (bot talks over docker network; no internet exposure)
- .dockerignore: exclude .github + lavalink/ from build context
This commit is contained in:
loki5512344 2026-08-19 14:00:39 +02:00
parent 54cc26e675
commit 05f8e44213
Signed by: boba
GPG key ID: 253067914055423B
3 changed files with 14 additions and 3 deletions

View file

@ -3,8 +3,10 @@ services:
image: ghcr.io/lavalink-devs/lavalink:4-alpine
container_name: loki-lavalink
restart: unless-stopped
depends_on:
- spotify-tokener
ports:
- "2333:2333"
- "127.0.0.1:2333:2333"
volumes:
- ./lavalink/application.yml:/opt/Lavalink/application.yml:ro
- ./lavalink/plugins/:/opt/Lavalink/plugins/
@ -13,6 +15,12 @@ services:
JAVA_OPTS: "-Xmx1G -Xms256M"
SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID}
SPOTIFY_CLIENT_SECRET: ${SPOTIFY_CLIENT_SECRET}
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null --header=Authorization:Hch4HiVCxkKs9JPiSnrt4Q http://localhost:2333/v4/info || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
spotify-tokener:
image: ghcr.io/topi314/spotify-tokener:master
@ -29,7 +37,8 @@ services:
container_name: loki-bot
restart: unless-stopped
depends_on:
- lavalink
lavalink:
condition: service_healthy
mem_limit: 1g
ports:
- "8712:8712"