-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (39 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
52 lines (39 loc) · 1.38 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
# AI Code Trust Validator - Docker Image
# Multi-stage build for minimal image size
# Build stage
FROM python:3.11-slim as builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy and install
COPY pyproject.toml .
COPY ai_trust_validator ./ai_trust_validator
RUN pip install --no-cache-dir .
# Runtime stage
FROM python:3.11-slim
WORKDIR /app
# Install runtime dependencies only
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy from builder
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Create non-root user
RUN useradd -m -u 1000 validator
USER validator
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Default port
EXPOSE 8080
# Labels
LABEL org.opencontainers.image.title="AI Code Trust Validator"
LABEL org.opencontainers.image.description="Validate AI-generated code for security, hallucinations & logic errors"
LABEL org.opencontainers.image.url="https://github.com/rudra496/ai-code-trust-validator"
LABEL org.opencontainers.image.author="Rudra Sarker"
# Entry point
ENTRYPOINT ["aitrust"]
CMD ["--help"]