-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContainerfile
More file actions
60 lines (46 loc) · 2.1 KB
/
Containerfile
File metadata and controls
60 lines (46 loc) · 2.1 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
# Red Hat Lightspeed Agent for Google Cloud - Container Image
# Built on Red Hat Universal Base Image (UBI)
# =============================================================================
# Build Stage
# =============================================================================
FROM registry.access.redhat.com/ubi10/python-312-minimal:latest as builder
WORKDIR /opt/app-root/src
# Install Python dependencies
COPY pyproject.toml README.md ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir ".[agent]"
# =============================================================================
# Production Stage
# =============================================================================
FROM registry.access.redhat.com/ubi10/python-312-minimal:latest as production
# Labels for container metadata
LABEL org.opencontainers.image.title="Red Hat Lightspeed Agent for Google Cloud"
LABEL org.opencontainers.image.description="A2A-ready agent for Red Hat Insights using Google ADK"
LABEL org.opencontainers.image.vendor="Red Hat"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL io.k8s.display-name="Red Hat Lightspeed Agent for Google Cloud"
LABEL io.k8s.description="A2A-ready agent for Red Hat Insights using Google ADK"
WORKDIR /opt/app-root/src
# Copy installed packages from builder
COPY --from=builder /opt/app-root/lib/python3.12/site-packages /opt/app-root/lib/python3.12/site-packages
# Copy application code
COPY src/ ./src/
COPY agent.py ./
COPY pyproject.toml README.md ./
# Install the application
RUN pip install --no-cache-dir -e ".[agent]"
# Create directory for data (if using SQLite)
RUN mkdir -p /opt/app-root/src/data
# Environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
AGENT_HOST=0.0.0.0 \
AGENT_PORT=8000
# Expose the agent port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import httpx; httpx.get('http://localhost:8000/health').raise_for_status()"
# UBI images already run as non-root user (UID 1001)
# Default command
CMD ["python", "-m", "lightspeed_agent.main"]