From 8435c92b72d2f6d56eb83ae517c76ca678094f41 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Mon, 8 Dec 2025 12:46:49 +0100 Subject: [PATCH] build: Optimize Dockerfile by adding DART VM memory option and removing diagnostic commands. --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62d136e..d24c196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,8 @@ WORKDIR /app # Safe directory configuration for git RUN git config --global --add safe.directory /app -# Diagnostic: Show Flutter version -RUN flutter --version +# Optimize DART VM Memory for build to prevent OOM +ENV DART_VM_OPTIONS="--old_gen_heap_size=2048" # Enable web support (idempotent) RUN flutter config --enable-web @@ -29,13 +29,9 @@ COPY . . # Re-run pub get after copying source to ensure lockfile consistency RUN flutter pub get -# Diagnostic: Analyze for errors before building -# Using || true to prevent build failure on warnings, as we want to see the error in build step if any -RUN flutter analyze --no-fatal-warnings || true - # Build web application (CanvasKit renderer is now default) # Added --no-tree-shake-icons to prevent potential font issues in some environments -RUN flutter build web --release --base-href="/" --no-tree-shake-icons --verbose +RUN flutter build web --release --base-href="/" --no-tree-shake-icons # ============================================ # Stage 2: Serve with custom Dart server (with API proxy)