Added Dockerfile and K8s manifests for deployment
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install system dependencies (if any needed for pypdf or others)
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copy requirements and install
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY server.py .
|
||||||
|
COPY README.md .
|
||||||
|
|
||||||
|
# Create a non-root user
|
||||||
|
RUN useradd -m appuser && chown -R appuser:appuser /app
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
# Expose the SSE port
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# Run in SSE mode
|
||||||
|
CMD ["python", "server.py", "--transport", "sse", "--port", "8000", "--host", "0.0.0.0"]
|
||||||
51
k8s/deployment.yaml
Normal file
51
k8s/deployment.yaml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: knowledge-mcp
|
||||||
|
namespace: openshift-gitops
|
||||||
|
labels:
|
||||||
|
app: knowledge-mcp
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: knowledge-mcp
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: knowledge-mcp
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: server
|
||||||
|
image: image-registry.openshift-image-registry.svc:5000/openshift-gitops/knowledge-mcp:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: QDRANT_URL
|
||||||
|
value: "http://qdrant.openshift-gitops.svc:6333"
|
||||||
|
- name: TEI_URL
|
||||||
|
value: "http://text-embeddings.tei.svc.cluster.local:8080"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "256Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "512Mi"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: knowledge-mcp
|
||||||
|
namespace: openshift-gitops
|
||||||
|
labels:
|
||||||
|
app: knowledge-mcp
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
app: knowledge-mcp
|
||||||
@@ -4,3 +4,4 @@ qdrant-client
|
|||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
pypdf
|
pypdf
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
uvicorn
|
||||||
|
|||||||
Reference in New Issue
Block a user