services: lavalink: image: fredboat/lavalink:latest container_name: lavalink restart: unless-stopped networks: - bot-network ports: - "2333:2333" environment: - LAVALINK_SERVER_PASSWORD=${LAVALINK_PASSWORD} volumes: - ./application.yml:/opt/Lavalink/application.yml:ro,Z # Add healthcheck to verify Lavalink is ready healthcheck: test: > curl -H "Authorization: ${LAVALINK_PASSWORD}" -f http://localhost:2333/version interval: 5s timeout: 5s retries: 3 start_period: 5s # Give Lavalink time to start up initially bot: build: . container_name: discord-music-bot restart: unless-stopped networks: - bot-network env_file: - .env environment: - LAVALINK_HOST=lavalink - LAVALINK_PORT=2333 - LAVALINK_PASSWORD=${LAVALINK_PASSWORD} # Update depends_on to wait for healthcheck depends_on: lavalink: condition: service_healthy networks: bot-network: driver: bridge