From da474ac5f29583eb58166d559280cbac1a968548 Mon Sep 17 00:00:00 2001 From: "Ehsan.Asadi" Date: Tue, 30 Dec 2025 20:00:23 +0330 Subject: [PATCH] =?UTF-8?q?fix:=20=D8=A7=D8=B5=D9=84=D8=A7=D8=AD=20Dockerf?= =?UTF-8?q?ile=20=D9=88=20Helm=20=D8=A8=D8=B1=D8=A7=DB=8C=20=D8=B1=D9=81?= =?UTF-8?q?=D8=B9=20=D9=85=D8=B4=DA=A9=D9=84=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - حذف reflex init که فایل‌ها را overwrite می‌کرد - نگه داشتن .web directory برای frontend static files - اصلاح service targetPort از hardcode به values - افزایش readiness/liveness probe timing به 120 ثانیه - اصلاح export برای production mode --- Dockerfile | 11 ++++++----- helm/peikarband/templates/service.yaml | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index febaa42..40ff487 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,11 +51,12 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ # Copy application code (excluding .dockerignore items) COPY --chown=root:root . . -# Initialize and build Reflex app -RUN python -m reflex init --template blank && \ - python -m reflex export --frontend-only --no-zip || true +# Build and export Reflex app for production +# Export creates .web directory with frontend static files +RUN python -m reflex export --no-zip # Aggressive cleanup to reduce layer size +# NOTE: Keep .web directory - it contains frontend static files needed for --backend-only mode RUN set -ex && \ # Remove Python cache find /build -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ @@ -65,8 +66,8 @@ RUN set -ex && \ rm -rf /build/tests /build/docs /build/scripts && \ rm -rf /build/.git /build/.github /build/.vscode && \ rm -rf /build/venv /build/env && \ - # Remove build artifacts that were created - rm -rf /build/.web /build/node_modules && \ + # Remove node_modules but KEEP .web (frontend static files) + rm -rf /build/node_modules && \ # Remove large duplicate assets from root rm -f /build/*.gif /build/*.mp4 /build/*.mov 2>/dev/null || true && \ # Keep only necessary configs diff --git a/helm/peikarband/templates/service.yaml b/helm/peikarband/templates/service.yaml index a855c6d..2775d85 100644 --- a/helm/peikarband/templates/service.yaml +++ b/helm/peikarband/templates/service.yaml @@ -8,11 +8,11 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.backend.port }} - targetPort: backend + targetPort: {{ .Values.service.backend.targetPort }} protocol: TCP name: backend - port: {{ .Values.service.frontend.port }} - targetPort: frontend + targetPort: {{ .Values.service.frontend.targetPort }} protocol: TCP name: frontend selector: