Update Dockerfile
This commit is contained in:
34
Dockerfile
34
Dockerfile
@@ -4,7 +4,7 @@ FROM python:3.10-slim
|
|||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install build dependencies and curl for healthcheck
|
# Install build dependencies, curl for healthcheck
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
gcc \
|
gcc \
|
||||||
@@ -13,20 +13,34 @@ RUN apt-get update && \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY pyproject.toml poetry.lock ./
|
|
||||||
COPY splunk_mcp.py ./
|
COPY splunk_mcp.py ./
|
||||||
COPY README.md ./
|
COPY README.md ./
|
||||||
COPY .env.example ./
|
COPY .env.example ./
|
||||||
|
|
||||||
# Install poetry and dependencies
|
# Install required dependencies directly
|
||||||
RUN pip install --no-cache-dir poetry && \
|
RUN pip install --no-cache-dir fastapi uvicorn python-dotenv pydantic splunk-sdk
|
||||||
poetry config virtualenvs.create false && \
|
|
||||||
poetry install --no-interaction --no-ansi
|
|
||||||
|
|
||||||
# Si lo anterior no funciona, prueba instalando fastapi directamente
|
|
||||||
RUN pip install --no-cache-dir fastapi uvicorn
|
|
||||||
|
|
||||||
# Create directory for environment file
|
# Create directory for environment file
|
||||||
RUN mkdir -p /app/config
|
RUN mkdir -p /app/config
|
||||||
|
|
||||||
# Resto del Dockerfile igual que antes...
|
# Set environment variables
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
ENV SPLUNK_HOST=
|
||||||
|
ENV SPLUNK_PORT=8089
|
||||||
|
ENV SPLUNK_USERNAME=
|
||||||
|
ENV SPLUNK_PASSWORD=
|
||||||
|
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"]
|
||||||
Reference in New Issue
Block a user