@@ -111,13 +111,21 @@ RUN pnpm deploy --filter @norish/web --prod /app/deploy && \
111111 turbo turbo-* && \
112112 # Remove packages superseded by system binaries (apk add ffmpeg)
113113 rm -rf ffmpeg-static && \
114- # Remove wrong-platform binaries (keep only linux-arm64-musl for Alpine)
115- rm -rf @next/swc-darwin-* @next/swc-win32-* @next/swc-linux-x64-gnu \
116- @swc/core-darwin-* @swc/core-win32-* @swc/core-linux-x64-* \
117- @img/sharp-darwin-* @img/sharp-win32-* @img/sharp-linux-x64 \
118- @img/sharp-libvips-darwin-* @img/sharp-libvips-win32-* @img/sharp-libvips-linux-x64 \
119- lightningcss-darwin-* lightningcss-win32-* lightningcss-linux-x64-gnu \
120- @next/eslint-plugin-next
114+ # Remove wrong-platform native binaries (keep only linux musl variants for Alpine)
115+ # pnpm deploy creates a flat node_modules: scoped packages are at @scope/pkg-name
116+ cd @next && find . -maxdepth 1 -type d -name 'swc-*' \
117+ ! -name '*linux-x64-musl*' ! -name '*linux-arm64-musl*' \
118+ -exec rm -rf {} + && cd .. && \
119+ cd @swc && find . -maxdepth 1 -type d -name 'core-*' \
120+ ! -name '*linux-x64-musl*' ! -name '*linux-arm64-musl*' \
121+ -exec rm -rf {} + && cd .. && \
122+ cd @img && find . -maxdepth 1 -type d -name 'sharp-*' \
123+ ! -name '*linuxmusl-x64*' ! -name '*linuxmusl-arm64*' \
124+ -exec rm -rf {} + && cd .. && \
125+ find . -maxdepth 1 -type d -name 'lightningcss-*' \
126+ ! -name '*linux-x64-musl*' ! -name '*linux-arm64-musl*' \
127+ -exec rm -rf {} + && \
128+ rm -rf @next/eslint-plugin-next
121129
122130# Strip test files and dev configs from packages/ before they get copied to runtime.
123131# This avoids shipping test fixtures, vitest configs, and TS build configs.
0 commit comments