fix: resolve Docker FFmpeg SIGSEGV crash and build failures (#24)

The ffmpeg-static npm package bundles a pre-compiled binary that passes
`ffmpeg -version` but crashes with SIGSEGV during actual audio processing
inside Docker containers (incompatible glibc/missing shared libraries).

Changes:
- Install system FFmpeg via apt-get in Docker production stage, which is
  always compatible with the container runtime
- Reverse FFmpeg resolution priority in player.ts: prefer system FFmpeg,
  fall back to ffmpeg-static (for non-Docker environments like Windows)
- Optimize Dockerfile multi-stage build: compile native modules (opus,
  better-sqlite3) in builder stage and copy to production, eliminating
  the need for build tools (python3, make, g++) in the production image
- Fix qq-music-api dependency from file:../qq-music-api (path outside
  Docker build context, breaks npm ci) to npm registry ^2.2.10

https://claude.ai/code/session_01JAV8sBokoifKh4Hc8XbJws
This commit is contained in:
Claude committed 2026-04-12 14:41:48 +00:00
1 parent dab02ede9c
commit 47e0d0f288
5 files changed
+649 -394

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
"@discordjs/opus": "^0.10.0",
"@honeybbq/teamspeak-client": "^0.2.1",
"@koa/router": "^15.4.0",
"@sansenjian/qq-music-api": "file:../qq-music-api",
"@sansenjian/qq-music-api": "^2.2.10",
"axios": "^1.14.0",
"better-sqlite3": "^12.8.0",
"chalk": "^5.6.2",