From 602026e066da97f4d99e0306290439549bbaab39 Mon Sep 17 00:00:00 2001 From: "Ehsan.Asadi" Date: Tue, 30 Dec 2025 19:32:17 +0330 Subject: [PATCH] fixe ci --- Dockerfile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f7cf1b..febaa42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ARG BUILD_DATE # ============================================ # Stage 1: Builder # ============================================ -FROM python:${PYTHON_VERSION}-slim as builder +FROM python:${PYTHON_VERSION}-slim AS builder # Re-declare ARGs for this stage ARG NODE_VERSION=20 @@ -48,17 +48,30 @@ COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ pip install --no-cache-dir --user -r requirements.txt -# Copy application code -COPY . . +# 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 -# Clean up unnecessary files -RUN find /build -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ +# Aggressive cleanup to reduce layer size +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 "*.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 @@ -78,7 +91,6 @@ WORKDIR /app # Install runtime dependencies only RUN apt-get update && apt-get install -y --no-install-recommends \ - postgresql-client \ curl \ ca-certificates \ tini \