forked from livehybrid/splunk-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (41 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
50 lines (41 loc) · 1.14 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
# Use Python 3.10 slim image as base
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install build dependencies, curl for healthcheck, and uv
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
python3-dev \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir uv
# Copy project files
COPY pyproject.toml poetry.lock ./
COPY splunk_mcp.py ./
COPY README.md ./
COPY .env.example ./
# Install dependencies using uv (only main group by default)
RUN uv pip install --system poetry && \
uv pip install --system .
# Create directory for environment file
RUN mkdir -p /app/config
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV SPLUNK_HOST=
ENV SPLUNK_PORT=8089
ENV SPLUNK_USERNAME=
ENV SPLUNK_PASSWORD=
ENV SPLUNK_TOKEN=
ENV SPLUNK_SCHEME=https
ENV FASTMCP_LOG_LEVEL=INFO
ENV FASTMCP_PORT=8001
ENV DEBUG=false
ENV MODE=sse
# Expose the FastAPI port
EXPOSE 8001
# Add healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${FASTMCP_PORT}/health || exit 1
# Default to SSE mode
CMD ["python", "splunk_mcp.py", "sse"]