fix: اصلاح Dockerfile و Helm برای رفع مشکل 404
Some checks failed
CD - Build & Deploy / release (push) Has been cancelled
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
ci/woodpecker/push/woodpecker Pipeline failed
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled

- حذف reflex init که فایل‌ها را overwrite می‌کرد
- نگه داشتن .web directory برای frontend static files
- اصلاح service targetPort از hardcode به values
- افزایش readiness/liveness probe timing به 120 ثانیه
- اصلاح export برای production mode
This commit is contained in:
Ehsan.Asadi
2025-12-30 20:00:23 +03:30
parent bb88657562
commit da474ac5f2
2 changed files with 8 additions and 7 deletions

View File

@@ -51,11 +51,12 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
# Copy application code (excluding .dockerignore items) # Copy application code (excluding .dockerignore items)
COPY --chown=root:root . . COPY --chown=root:root . .
# Initialize and build Reflex app # Build and export Reflex app for production
RUN python -m reflex init --template blank && \ # Export creates .web directory with frontend static files
python -m reflex export --frontend-only --no-zip || true RUN python -m reflex export --no-zip
# Aggressive cleanup to reduce layer size # Aggressive cleanup to reduce layer size
# NOTE: Keep .web directory - it contains frontend static files needed for --backend-only mode
RUN set -ex && \ RUN set -ex && \
# Remove Python cache # Remove Python cache
find /build -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ 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/tests /build/docs /build/scripts && \
rm -rf /build/.git /build/.github /build/.vscode && \ rm -rf /build/.git /build/.github /build/.vscode && \
rm -rf /build/venv /build/env && \ rm -rf /build/venv /build/env && \
# Remove build artifacts that were created # Remove node_modules but KEEP .web (frontend static files)
rm -rf /build/.web /build/node_modules && \ rm -rf /build/node_modules && \
# Remove large duplicate assets from root # Remove large duplicate assets from root
rm -f /build/*.gif /build/*.mp4 /build/*.mov 2>/dev/null || true && \ rm -f /build/*.gif /build/*.mp4 /build/*.mov 2>/dev/null || true && \
# Keep only necessary configs # Keep only necessary configs

View File

@@ -8,11 +8,11 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
- port: {{ .Values.service.backend.port }} - port: {{ .Values.service.backend.port }}
targetPort: backend targetPort: {{ .Values.service.backend.targetPort }}
protocol: TCP protocol: TCP
name: backend name: backend
- port: {{ .Values.service.frontend.port }} - port: {{ .Values.service.frontend.port }}
targetPort: frontend targetPort: {{ .Values.service.frontend.targetPort }}
protocol: TCP protocol: TCP
name: frontend name: frontend
selector: selector: