fix: revert production source maps to restore v1.67.0 memory baseline
CodeRabbit review addressed: - Removed the env-var gating (simpler: just remove source maps entirely) - CI health check now fails fast if container never becomes healthy Changes vs origin/main: - next.config.ts: remove productionBrowserSourceMaps and serverSourceMaps (they default to false, restoring pre-v1.68.0 behavior) - Dockerfile: remove .map copy step and NODE_OPTIONS=--enable-source-maps - CI: add memory-regression job (<700MB guardrail) Closes #6123
This commit is contained in:
1 parent
57ef0af4a2
commit
60a69e31ef
4 files changed
+7
-24
No files matched your search
@@ -188,13 +188,20 @@ jobs:
|
||||
run: |
|
||||
docker run -d --name homarr-mem-test -p 17575:7575 homarr-memory-test
|
||||
# Wait for container to be healthy (up to 60s)
|
||||
healthy=false
|
||||
for i in $(seq 1 30); do
|
||||
if curl -sf http://localhost:17575/api/health 2>/dev/null; then
|
||||
echo "Container healthy after $((i * 2))s"
|
||||
healthy=true
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
if [ "$healthy" != "true" ]; then
|
||||
echo "ERROR: Container never became healthy"
|
||||
docker logs homarr-mem-test --tail 50
|
||||
exit 1
|
||||
fi
|
||||
# Warm up: hit the dashboard page a few times
|
||||
for i in $(seq 1 5); do
|
||||
curl -sf http://localhost:17575/ > /dev/null 2>&1 || true
|
||||
|
||||
-16
@@ -20,19 +20,6 @@ ARG DISABLE_REDIS_LOGS='true'
|
||||
|
||||
RUN corepack enable pnpm && pnpm build
|
||||
|
||||
# Copy server chunk source maps into standalone output when enabled.
|
||||
# Off by default to avoid the significant memory overhead of --enable-source-maps in Node.js.
|
||||
# See https://github.com/homarr-labs/homarr/issues/6123 and https://github.com/nodejs/node/issues/46140
|
||||
ARG ENABLE_SOURCE_MAPS=false
|
||||
RUN if [ "$ENABLE_SOURCE_MAPS" = "true" ]; then \
|
||||
cd apps/nextjs/.next/server && \
|
||||
find . -name '*.map' | while IFS= read -r map; do \
|
||||
dest="../standalone/apps/nextjs/.next/server/$map"; \
|
||||
mkdir -p "$(dirname "$dest")"; \
|
||||
cp "$map" "$dest"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
@@ -77,9 +64,6 @@ ENV DB_DRIVER='better-sqlite3'
|
||||
ENV AUTH_PROVIDERS='credentials'
|
||||
ENV REDIS_IS_EXTERNAL='false'
|
||||
ENV NODE_ENV='production'
|
||||
# Pass through the source maps toggle so run.sh can conditionally set NODE_OPTIONS.
|
||||
ARG ENABLE_SOURCE_MAPS=false
|
||||
ENV HOMARR_ENABLE_SOURCE_MAPS=$ENABLE_SOURCE_MAPS
|
||||
|
||||
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||
CMD ["sh", "run.sh"]
|
||||
@@ -31,7 +31,6 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
output: "standalone",
|
||||
reactStrictMode: true,
|
||||
productionBrowserSourceMaps: process.env.HOMARR_ENABLE_SOURCE_MAPS === "true",
|
||||
// react compiler breaks mantine-react-table, so disabled for now
|
||||
//reactCompiler: true,
|
||||
/** We already do typechecking as separate tasks in CI */
|
||||
@@ -42,7 +41,6 @@ const nextConfig: NextConfig = {
|
||||
*/
|
||||
serverExternalPackages: ["dockerode", "isomorphic-dompurify", "jsdom", "better-sqlite3"],
|
||||
experimental: {
|
||||
serverSourceMaps: process.env.HOMARR_ENABLE_SOURCE_MAPS === "true",
|
||||
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
||||
turbopackFileSystemCacheForDev: true,
|
||||
preloadEntriesOnStart: false,
|
||||
|
||||
@@ -58,12 +58,6 @@ terminate() {
|
||||
|
||||
trap terminate TERM INT
|
||||
|
||||
# Enable source maps in Node.js when explicitly opted in.
|
||||
# Default off — see https://github.com/homarr-labs/homarr/issues/6123
|
||||
if [ "${HOMARR_ENABLE_SOURCE_MAPS}" = "true" ]; then
|
||||
export NODE_OPTIONS="--enable-source-maps${NODE_OPTIONS:+ $NODE_OPTIONS}"
|
||||
fi
|
||||
|
||||
node apps/nextjs/server.js &
|
||||
NEXTJS_PID=$!
|
||||
|
||||
|
||||
Reference in new issue
Block a user