-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
91 lines (68 loc) · 2.65 KB
/
Dockerfile
File metadata and controls
91 lines (68 loc) · 2.65 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# =============================================================================
# IATP Sidecar Proxy - Production Docker Image
# =============================================================================
# This Dockerfile creates a production-ready IATP Sidecar that can protect
# any agent by intercepting and validating all requests.
#
# Build:
# docker build -t iatp-sidecar .
#
# Run:
# docker run -p 8081:8081 \
# -e IATP_AGENT_URL=http://my-agent:8000 \
# -e IATP_AGENT_ID=my-agent \
# iatp-sidecar
# =============================================================================
FROM python:3.11-slim
# Set labels
LABEL maintainer="Imran Siddique"
LABEL description="Inter-Agent Trust Protocol (IATP) Sidecar Proxy"
LABEL version="0.2.0"
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy IATP library
COPY iatp/ /app/iatp/
COPY setup.py /app/
COPY README.md /app/
# Install IATP as a package
RUN pip install -e .
# Set Python path
ENV PYTHONPATH=/app
# =============================================================================
# Environment Configuration
# =============================================================================
# These can be overridden at runtime with -e flags
# The URL of the upstream agent this sidecar protects
ENV IATP_AGENT_URL=http://localhost:8000
# The port the sidecar listens on
ENV IATP_PORT=8081
# Unique identifier for the agent
ENV IATP_AGENT_ID=default-agent
# Trust level: verified_partner, trusted, standard, unknown, untrusted
ENV IATP_TRUST_LEVEL=standard
# Reversibility: full, partial, none
ENV IATP_REVERSIBILITY=partial
# Data retention: ephemeral, temporary, permanent
ENV IATP_RETENTION=temporary
# Require human approval for sensitive operations
ENV IATP_HUMAN_IN_LOOP=false
# Allow data use for training
ENV IATP_TRAINING_CONSENT=false
# =============================================================================
# Expose port and configure health check
# =============================================================================
EXPOSE 8081
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8081/health || exit 1
# =============================================================================
# Run the sidecar
# =============================================================================
CMD ["uvicorn", "iatp.main:app", "--host", "0.0.0.0", "--port", "8081"]