-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (58 loc) · 3.5 KB
/
Copy pathDockerfile
File metadata and controls
69 lines (58 loc) · 3.5 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
62
63
64
65
66
67
68
69
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
# Before building this image, run `python scripts/bake_skill_metadata.py` so
# `.bundle_skill_commit_info.json` is present in the Docker build context.
FROM python:3.12-slim AS builder
WORKDIR /app
COPY pyproject.toml hatch_build.py /app/
COPY .bundle_skill_commit_info.json /app/
COPY agent-skills/blockscout-analysis /app/agent-skills/blockscout-analysis
COPY blockscout_mcp_server /app/blockscout_mcp_server
RUN pip install --no-cache-dir uv
RUN uv build --wheel --out-dir /tmp/dist
FROM python:3.12-slim
WORKDIR /app
COPY --from=builder /tmp/dist /tmp/dist
RUN pip install --no-cache-dir /tmp/dist/*.whl \
&& rm -rf /tmp/dist
ENV PYTHONUNBUFFERED=1
# Expose environment variables that can be set at runtime
# Set defaults here to document expected environment variables
ENV BLOCKSCOUT_BS_TIMEOUT="120.0"
ENV BLOCKSCOUT_BS_REQUEST_MAX_RETRIES="3"
ENV BLOCKSCOUT_BENS_URL="https://bens.services.blockscout.com"
ENV BLOCKSCOUT_BENS_TIMEOUT="30.0"
ENV BLOCKSCOUT_PRO_API_BASE_URL="https://api.blockscout.com"
# ENV BLOCKSCOUT_PRO_API_KEY="" # Required for data access — pass at runtime (e.g. -e BLOCKSCOUT_PRO_API_KEY=...) to avoid embedding the key in the image
ENV BLOCKSCOUT_METADATA_TIMEOUT="30.0"
ENV BLOCKSCOUT_CHAINSCOUT_URL="https://chains.blockscout.com"
ENV BLOCKSCOUT_CHAINSCOUT_TIMEOUT="15.0"
ENV BLOCKSCOUT_CHAINS_LIST_TTL_SECONDS="300"
ENV BLOCKSCOUT_PROGRESS_INTERVAL_SECONDS="15.0"
ENV BLOCKSCOUT_CONTRACTS_CACHE_MAX_NUMBER="10"
ENV BLOCKSCOUT_CONTRACTS_CACHE_TTL_SECONDS="3600"
ENV BLOCKSCOUT_NFT_PAGE_SIZE="10"
ENV BLOCKSCOUT_LOGS_PAGE_SIZE="10"
ENV BLOCKSCOUT_ADVANCED_FILTERS_PAGE_SIZE="10"
ENV BLOCKSCOUT_RPC_REQUEST_TIMEOUT="60.0"
ENV BLOCKSCOUT_RPC_POOL_PER_HOST="50"
ENV BLOCKSCOUT_MCP_USER_AGENT="Blockscout MCP"
# ENV BLOCKSCOUT_MIXPANEL_TOKEN="" # Intentionally commented out: pass at runtime to avoid embedding secrets in image
# ENV BLOCKSCOUT_MIXPANEL_API_HOST="" # Intentionally commented out: the ingestion region default (api-eu.mixpanel.com) lives in config.py. Setting a value here — including an empty string — would override that default. Pass at runtime (e.g. -e BLOCKSCOUT_MIXPANEL_API_HOST=api.mixpanel.com) for a US or other-region project.
ENV BLOCKSCOUT_DISABLE_COMMUNITY_TELEMETRY="false"
ENV BLOCKSCOUT_INTERMEDIARY_HEADER="Blockscout-MCP-Intermediary"
ENV BLOCKSCOUT_INTERMEDIARY_ALLOWLIST="ClaudeDesktop,HigressPlugin,EvaluationSuite"
ENV BLOCKSCOUT_PRO_API_KEY_HEADER="Blockscout-MCP-Pro-Api-Key"
ENV BLOCKSCOUT_SESSION_MCP_MAX_CALLS="5"
ENV BLOCKSCOUT_SESSION_REST_MAX_CALLS="5"
ENV BLOCKSCOUT_SESSION_TTL_SECONDS="900"
# ENV BLOCKSCOUT_SESSION_SWEEP_INTERVAL_SECONDS="" # Intentionally commented out: unset means "sweep expired session rows once per TTL" — set at runtime only to decouple sweep cadence from the TTL
# ENV BLOCKSCOUT_SESSION_SECRET="" # Intentionally commented out: the session-gating feature switch is a signing secret — pass at runtime (-e or a secret manager); never embed it in the image
# ENV BLOCKSCOUT_SESSION_DB_PATH="" # Intentionally commented out: must point into a mounted persistent volume — pass at runtime together with the volume mount
# Set the default transport mode. Can be overridden at runtime with -e.
# Options: "stdio" (default), "http"
ENV BLOCKSCOUT_MCP_TRANSPORT="stdio"
ENV BLOCKSCOUT_DEV_JSON_RESPONSE="false"
ENV PORT="8000"
# Expose the default port. This can be overridden at runtime by the PORT environment variable.
EXPOSE 8000
CMD ["python", "-m", "blockscout_mcp_server"]