-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
77 lines (66 loc) · 2.25 KB
/
Copy pathDockerfile
File metadata and controls
77 lines (66 loc) · 2.25 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# EmbedGuard Docker Image
# Enables one-line reproducibility of all paper results
#
# Build:
# docker build -t embedguard:v1.0 .
#
# Run all benchmarks (reproduces Table 2-4 in the paper):
# docker run --rm embedguard:v1.0
#
# Run specific benchmarks:
# docker run --rm embedguard:v1.0 python examples/run_benchmarks.py --injection
# docker run --rm embedguard:v1.0 python examples/run_benchmarks.py --benchmark nq
#
# Publish to GitHub Container Registry:
# docker tag embedguard:v1.0 ghcr.io/neerazz/embedguard:v1.0
# docker push ghcr.io/neerazz/embedguard:v1.0
FROM python:3.10-slim
# Metadata
LABEL org.opencontainers.image.title="EmbedGuard"
LABEL org.opencontainers.image.description="Cross-Layer Detection and Provenance Attestation for RAG Systems"
LABEL org.opencontainers.image.version="1.0.0"
LABEL org.opencontainers.image.authors="Neeraj Kumar Singh Beshane"
LABEL org.opencontainers.image.source="https://github.com/neerazz/embedguard"
LABEL org.opencontainers.image.licenses="MIT"
# Set working directory
WORKDIR /embedguard
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY embedguard/ embedguard/
COPY examples/ examples/
COPY data/ data/
COPY scripts/ scripts/
COPY tests/ tests/
COPY pyproject.toml .
COPY README.md .
COPY LICENSE .
# Create results directory
RUN mkdir -p results
# Set environment variables for reproducibility
ENV EMBEDGUARD_SEED=42
ENV PYTHONPATH=/embedguard
ENV PYTHONUNBUFFERED=1
# Default command: run all benchmarks
CMD ["python", "examples/run_benchmarks.py", "--all"]
# Alternative entrypoints:
# Run injection benchmark only:
# docker run --rm embedguard:v1.0 python examples/run_benchmarks.py --injection
#
# Run specific benign benchmark:
# docker run --rm embedguard:v1.0 python examples/run_benchmarks.py --benchmark nq
#
# Run statistical tests:
# docker run --rm embedguard:v1.0 python scripts/statistical_tests.py
#
# Run unit tests:
# docker run --rm embedguard:v1.0 pytest tests/ -v
#
# Interactive shell:
# docker run -it --rm embedguard:v1.0 /bin/bash