fixe ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (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

This commit is contained in:
Ehsan.Asadi
2025-12-30 19:32:17 +03:30
parent 45afc7ea7d
commit 602026e066

View File

@@ -10,7 +10,7 @@ ARG BUILD_DATE
# ============================================ # ============================================
# Stage 1: Builder # Stage 1: Builder
# ============================================ # ============================================
FROM python:${PYTHON_VERSION}-slim as builder FROM python:${PYTHON_VERSION}-slim AS builder
# Re-declare ARGs for this stage # Re-declare ARGs for this stage
ARG NODE_VERSION=20 ARG NODE_VERSION=20
@@ -48,17 +48,30 @@ COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir --user -r requirements.txt pip install --no-cache-dir --user -r requirements.txt
# Copy application code # Copy application code (excluding .dockerignore items)
COPY . . COPY --chown=root:root . .
# Initialize and build Reflex app # Initialize and build Reflex app
RUN python -m reflex init --template blank && \ RUN python -m reflex init --template blank && \
python -m reflex export --frontend-only --no-zip || true python -m reflex export --frontend-only --no-zip || true
# Clean up unnecessary files # Aggressive cleanup to reduce layer size
RUN find /build -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ RUN set -ex && \
# Remove Python cache
find /build -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \
find /build -type f -name "*.pyc" -delete && \ find /build -type f -name "*.pyc" -delete && \
find /build -type f -name "*.pyo" -delete find /build -type f -name "*.pyo" -delete && \
# Remove development files
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 large duplicate assets from root
rm -f /build/*.gif /build/*.mp4 /build/*.mov 2>/dev/null || true && \
# Keep only necessary configs
find /build -type f -name "docker-compose*.yml" -delete && \
find /build -type f -name "Makefile" -delete
# ============================================ # ============================================
# Stage 2: Runtime # Stage 2: Runtime
@@ -78,7 +91,6 @@ WORKDIR /app
# Install runtime dependencies only # Install runtime dependencies only
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql-client \
curl \ curl \
ca-certificates \ ca-certificates \
tini \ tini \