-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (47 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
61 lines (47 loc) · 1.74 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
# =============================================================================
# MCP Memory Service - Dockerfile
# =============================================================================
# Build : docker build -t mcp-memory .
# Run : docker run -p 8002:8002 --env-file .env mcp-memory
# =============================================================================
# Sécurité v2.1.0 : version épinglée (I2)
FROM python:3.11.12-slim
# Métadonnées
LABEL maintainer="Cloud Temple"
LABEL description="MCP Memory Service - Knowledge Graph Memory for AI Agents"
LABEL version="1.0.0"
# Variables d'environnement Python
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Répertoire de travail
WORKDIR /app
# Dépendances système
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libffi-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copie et installation des dépendances Python
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Créer un utilisateur non-root pour la sécurité
RUN groupadd -r mcp && useradd -r -g mcp -d /app -s /sbin/nologin mcp
# Copie des ontologies
COPY ONTOLOGIES/ ./ONTOLOGIES/
# Copie de la version et du code source
COPY VERSION .
COPY src/ ./src/
# Donner les droits à l'utilisateur mcp
RUN chown -R mcp:mcp /app
# Port exposé
EXPOSE 8002
# Passer en utilisateur non-root
USER mcp
# Healthcheck via /health endpoint (léger, pas de fork Python)
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -sf http://localhost:8002/health -o /dev/null 2>/dev/null
# Point d'entrée
ENTRYPOINT ["python", "-m", "src.mcp_memory.server"]
CMD ["--port", "8002"]