Skip to content

Commit 8ffaff3

Browse files
committed
fixes
1 parent 78b94a7 commit 8ffaff3

3 files changed

Lines changed: 39 additions & 57 deletions

File tree

‎.dockerignore‎

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,16 @@
22
.git
33
.gitignore
44
.gitattributes
5+
.gitmodules
56

67
# CI/CD
78
.github
89

9-
# Coding
10-
.ai
11-
.vscode
12-
13-
# dependencies
14-
composer-cache
15-
vendor/
16-
node_modules/
17-
18-
# Documentation
19-
README.md
20-
docs/
21-
22-
# Development files
23-
.editorconfig
24-
.php-cs-fixer.php
25-
.php-cs-fixer.cache
26-
.gitattributes
27-
.gitignore
28-
.php-cs-fixer.php
29-
.phpstaorm.meta.php
30-
.prettierrc.json
31-
AGENTS.md
32-
codecov.yml
33-
CONTRIBUTING.md
34-
Dockerfile
35-
eslint.config.js
36-
Makefile
37-
osv-scanner.toml
38-
phpstan-baseline.neon
39-
phpstan.neon
40-
phpunit.ci.xml
41-
phpunit.xml
42-
.phpunit.result.cache
43-
rector.php
44-
sonar-project.properties
45-
phpstan/*
46-
scripts/*
47-
vite/*
48-
secrets/*
49-
# Local testing @ildyria
50-
public/uploads-bck/*
51-
public/uploads/*
52-
*.sql
53-
54-
# IDE
55-
.ai/
56-
.claude/
10+
# IDE / editor
5711
.vscode/
5812
.idea/
13+
.ai/
14+
.claude/
5915
*.swp
6016
*.swo
6117
*~
@@ -64,5 +20,24 @@ public/uploads/*
6420
.DS_Store
6521
Thumbs.db
6622

23+
# Python artifacts
24+
__pycache__/
25+
*.py[cod]
26+
*.pyo
27+
.venv/
28+
*.egg-info/
29+
dist/
30+
build/
31+
.mypy_cache/
32+
.ruff_cache/
33+
.pytest_cache/
34+
htmlcov/
35+
coverage.xml
36+
.coverage
37+
6738
# Tests
68-
tests/*
39+
tests/
40+
41+
# Dev config
42+
.editorconfig
43+
codecov.yml

‎.github/workflows/CICD.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
branches:
66
- master
77
paths:
8-
- 'CICD.yaml'
8+
- '.github/workflows/CICD.yaml'
99
- '**/*.py'
1010
- 'pyproject.toml'
1111
- 'uv.lock'
1212
- 'Dockerfile'
1313
pull_request:
1414
paths:
15-
- 'CICD.yaml'
15+
- '.github/workflows/CICD.yaml'
1616
- '**/*.py'
1717
- 'pyproject.toml'
1818
- 'uv.lock'

‎Dockerfile‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Multi-stage build: keep the runtime image lean.
22

33
# ---------------------------------------------------------------------------
4-
# Stage 1 – builder: install dependencies and bake the model weights.
4+
# Stage 1 – builder: install dependencies only.
5+
# Targeted by CI (target: builder) to verify the build without downloading
6+
# the 300 MB model weights.
57
# ---------------------------------------------------------------------------
68
FROM python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d AS builder
79

@@ -18,12 +20,17 @@ WORKDIR /app
1820

1921
# Install dependencies only (no source code) so layer cache is reused when
2022
# only application code changes.
21-
COPY pyproject.toml uv.lock ./
23+
COPY pyproject.toml uv.lock README.md ./
2224
RUN uv sync --frozen --no-dev
2325

26+
# ---------------------------------------------------------------------------
27+
# Stage 2 – baked: add model weights on top of the installed dependencies.
2428
# Bake ArcFace + RetinaFace model weights into the image at build time.
2529
# The resulting image starts instantly and works in airgapped environments.
2630
# Model updates require an image rebuild.
31+
# ---------------------------------------------------------------------------
32+
FROM builder AS baked
33+
2734
RUN DEEPFACE_HOME=/root/.deepface uv run python -c \
2835
"from deepface import DeepFace; \
2936
import numpy as np; \
@@ -36,15 +43,15 @@ RUN DEEPFACE_HOME=/root/.deepface uv run python -c \
3643
print('ArcFace + RetinaFace models downloaded.')"
3744

3845
# ---------------------------------------------------------------------------
39-
# Stage 2 – runtime: copy only what's needed to run.
46+
# Stage 3 – runtime: copy only what's needed to run.
4047
# ---------------------------------------------------------------------------
4148
FROM python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d AS runtime
4249

4350
WORKDIR /app
4451

45-
# Copy the pre-built virtualenv and baked model weights from the builder stage.
46-
COPY --from=builder /app/.venv /app/.venv
47-
COPY --from=builder /root/.deepface /root/.deepface
52+
# Copy the pre-built virtualenv and baked model weights from the baked stage.
53+
COPY --from=baked /app/.venv /app/.venv
54+
COPY --from=baked /root/.deepface /root/.deepface
4855

4956
# Copy application source.
5057
COPY app/ ./app/

0 commit comments

Comments
 (0)