Fix import contact from google
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
b66c11a71e
commit
78b41c3b16
@ -29,7 +29,7 @@ steps:
|
|||||||
path:
|
path:
|
||||||
include: [ backend/** ]
|
include: [ backend/** ]
|
||||||
settings:
|
settings:
|
||||||
registry: harbor-core.dev-tools.svc.cluster.local
|
registry: harbor.dvirlabs.com
|
||||||
repo: my-apps/${CI_REPO_NAME}-backend
|
repo: my-apps/${CI_REPO_NAME}-backend
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
context: backend
|
context: backend
|
||||||
@ -40,6 +40,11 @@ steps:
|
|||||||
from_secret: DOCKER_USERNAME
|
from_secret: DOCKER_USERNAME
|
||||||
password:
|
password:
|
||||||
from_secret: DOCKER_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:
|
update-values-frontend:
|
||||||
name: Update frontend tag in values.yaml
|
name: Update frontend tag in values.yaml
|
||||||
|
|||||||
@ -22,3 +22,18 @@ htmlcov/
|
|||||||
dmypy.json
|
dmypy.json
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.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
|
||||||
|
|||||||
@ -1,29 +1,45 @@
|
|||||||
# Use Python 3.11 slim image as base
|
# Multi-stage build to reduce final image size
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim as builder
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
# Install build dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
gcc \
|
gcc \
|
||||||
postgresql-client \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy requirements file
|
# Copy requirements file
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies to a specific directory
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
|
||||||
|
|
||||||
# Copy application code
|
# Final stage - minimal runtime image
|
||||||
COPY . .
|
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 \
|
||||||
|
postgresql-client \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# 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.txt .
|
||||||
|
|
||||||
# Expose port 8000
|
# Expose port 8000
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1 \
|
||||||
|
PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
Loading…
x
Reference in New Issue
Block a user