-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
38 lines (31 loc) · 1.46 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
FROM python:3.12-slim
# Consolidated labels (single layer)
LABEL org.opencontainers.image.title="netlicensing-mcp" \
org.opencontainers.image.description="MCP server for the Labs64 NetLicensing API" \
org.opencontainers.image.source="https://github.com/Labs64/NetLicensing-MCP" \
org.opencontainers.image.licenses="Apache-2.0"
WORKDIR /app
# 1. Install dependencies first (layer-cached)
COPY pyproject.toml README.md ./
RUN pip install --no-cache-dir "mcp[cli]>=1.7.0" httpx python-dotenv
# 2. Copy source and install package (non-editable for production)
COPY src/ ./src/
COPY dist/*.whl ./
RUN pip install --no-cache-dir --no-deps \
$(ls netlicensing_mcp-*.whl | sort -V | tail -1)
# 3. Runtime config — inject via -e at docker run, no defaults baked in
# NETLICENSING_API_KEY — required, no default
# NETLICENSING_BASE_URL — optional override
ENV NETLICENSING_BASE_URL="https://go.netlicensing.io/core/v2/rest"
# 4. Drop root privileges — run as a non-root user for security
RUN useradd --no-create-home --shell /bin/false appuser
USER appuser
# stdio mode by default; pass args via docker run for http / verbose:
# docker run ... image → stdio (default)
# docker run ... image http → HTTP mode
# docker run ... image -v → verbose stdio
# docker run ... image http -v → verbose HTTP
# Or use env vars: MCP_TRANSPORT=http MCP_VERBOSE=true
EXPOSE 8000
ENTRYPOINT ["netlicensing-mcp"]
CMD []