-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.43 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
# ==========================================
# STAGE 1: Builder (Компилируем чистый Cosign)
# ==========================================
FROM golang:1.26-bookworm AS cosign-builder
ENV CGO_ENABLED=0
ENV GOMAXPROCS=2
RUN go install github.com/sigstore/cosign/v2/cmd/cosign@latest
# ==========================================
# STAGE 2: Main CLI Image
# ==========================================
FROM python:3.11-slim-bookworm
# (curl и git больше не нужны, так как мы не качаем Cosign из интернета!)
RUN apt-get update && apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=cosign-builder /go/bin/cosign /usr/local/bin/cosign
# --- Install Veritensor ---
WORKDIR /app
# Copy dependency definition from ROOT
COPY pyproject.toml .
# Create dummy package structure to allow installing dependencies
# before the actual code is copied. This speeds up re-builds.
RUN mkdir -p src/veritensor && touch src/veritensor/__init__.py
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir .
# Copy source code from ROOT
COPY src/ src/
# Copy config from ROOT
COPY veritensor.yaml .
# Re-install the package to link the actual source code
RUN pip install .
# --- Setup Entrypoint ---
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# The entrypoint script will handle argument parsing
ENTRYPOINT ["/entrypoint.sh"]