From 82315dd4abd8dcf6ea959169c5c38d0620f363fa Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Tue, 24 Mar 2026 07:37:50 +0200 Subject: [PATCH] Fix import contact from google --- .woodpecker.yaml | 7 +------ backend/.dockerignore | 15 --------------- backend/Dockerfile | 42 +++++++++++++----------------------------- 3 files changed, 14 insertions(+), 50 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 9179249..3d68271 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -29,7 +29,7 @@ steps: path: include: [ backend/** ] settings: - registry: harbor.dvirlabs.com + registry: harbor-core.dev-tools.svc.cluster.local repo: my-apps/${CI_REPO_NAME}-backend dockerfile: backend/Dockerfile context: backend @@ -40,11 +40,6 @@ steps: from_secret: DOCKER_USERNAME password: from_secret: DOCKER_PASSWORD - # Kaniko options to handle large images - build_args: - - --compressed-caching=false - - --snapshot-mode=redo - - --use-new-run update-values-frontend: name: Update frontend tag in values.yaml diff --git a/backend/.dockerignore b/backend/.dockerignore index aa16f26..fb216e9 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -22,18 +22,3 @@ htmlcov/ dmypy.json *.log .DS_Store -# Test files -test_*.py -*_test.py -# Development files -.git -.gitignore -.dockerignore -Dockerfile -README.md -*.md -# Migration scripts (if not needed at runtime) -migrations.sql -migrate_production.sql -run_migration.py -run_production_migration.py diff --git a/backend/Dockerfile b/backend/Dockerfile index bb24f86..11130a4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,45 +1,29 @@ -# Multi-stage build to reduce final image size -FROM python:3.11-slim as builder - -# Set working directory -WORKDIR /app - -# Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc \ - && rm -rf /var/lib/apt/lists/* - -# Copy requirements file -COPY requirements.txt . - -# Install Python dependencies to a specific directory -RUN pip install --no-cache-dir --prefix=/install -r requirements.txt - -# Final stage - minimal runtime image +# Use Python 3.11 slim image as base FROM python:3.11-slim # Set working directory WORKDIR /app -# Install only runtime dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ +# Install system dependencies +RUN apt-get update && apt-get install -y \ + gcc \ postgresql-client \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean + && rm -rf /var/lib/apt/lists/* -# Copy installed packages from builder -COPY --from=builder /install /usr/local - -# Copy only necessary application code (exclude test files, pycache, etc.) -COPY *.py . +# Copy requirements file COPY requirements.txt . +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + # Expose port 8000 EXPOSE 8000 # Set environment variables -ENV PYTHONUNBUFFERED=1 \ - PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 # Run the application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]