-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1.11 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
# Azure MCP Server - Python Edition
FROM python:3.11-slim
LABEL maintainer="Mehul Patel"
LABEL description="Model Context Protocol server for Azure Cloud and Azure DevOps"
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
# Copy dependency files
COPY pyproject.toml ./
# Install dependencies (without dev dependencies)
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
# Copy application code
COPY src/ ./src/
# Create non-root user
RUN useradd -m -u 1000 azureuser && \
chown -R azureuser:azureuser /app
USER azureuser
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "from azure_mcp_server.config import get_config; get_config()" || exit 1
# Run the server
CMD ["python", "-m", "azure_mcp_server.main"]