-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (47 loc) · 1.52 KB
/
Dockerfile
File metadata and controls
57 lines (47 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ---- Stage 1: Build Angular client ----
FROM node:22-alpine AS client-build
WORKDIR /app/client
COPY client/package.json client/package-lock.json ./
RUN npm ci
COPY client/ ./
RUN npx ng build
# ---- Stage 2: Python runtime with CUDA ----
FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-runtime
WORKDIR /app
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libimage-exiftool-perl \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Python dependencies (torch/torchvision already in base image)
COPY requirements.txt .
RUN sed -i '/^torch>=/d; /^torchvision>=/d' requirements.txt \
&& pip install --no-cache-dir -r requirements.txt
# Copy built Angular client
COPY --from=client-build /app/client/dist/client/browser client/dist/client/browser
# Copy Python source code
COPY api/ api/
COPY analyzers/ analyzers/
COPY comparison/ comparison/
COPY config/ config/
COPY db/ db/
COPY exiftool/ exiftool/
COPY faces/ faces/
COPY i18n/ i18n/
COPY models/ models/
COPY optimization/ optimization/
COPY processing/ processing/
COPY utils/ utils/
COPY plugins/ plugins/
COPY storage/ storage/
COPY validation/ validation/
COPY viewer/ viewer/
COPY facet.py database.py viewer.py tag_existing.py validate_db.py calibrate.py diagnostics.py ./
# scoring_config.json is NOT baked in — mount it via docker-compose volume
COPY pyproject.toml ./
RUN useradd --create-home --shell /bin/bash facet \
&& chown -R facet:facet /app
USER facet
EXPOSE 5000
CMD ["python", "viewer.py", "--production"]