-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (60 loc) · 2.65 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (60 loc) · 2.65 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
70
71
72
73
# Copyright 2026 OICR and UCSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---- build ----------------------------------------------------------------
FROM python:3.13-alpine3.24 AS builder
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /build
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
COPY pyproject.toml README.md LICENSE ./
COPY src ./src
# pip is only needed to build the venv; its vendored copies of msgpack and
# setuptools otherwise show up as CVEs in the runtime image.
RUN pip install . \
&& pip uninstall -y pip
# ---- runtime --------------------------------------------------------------
FROM python:3.13-alpine3.24
# Git tag or ref the image is built from, reported in the User-Agent sent to
# Dockstore. Left empty, the server falls back to the package version.
ARG GIT_REF=""
LABEL org.opencontainers.image.title="dockstore-mcp" \
org.opencontainers.image.description="Model Context Protocol server for Dockstore" \
org.opencontainers.image.url="https://dockstore.org" \
org.opencontainers.image.source="https://github.com/dockstore/mcp" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.vendor="OICR and UCSC"
RUN apk upgrade --no-cache \
&& python -m pip uninstall -y pip \
&& adduser -D -u 10001 -s /sbin/nologin dockstore
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}" \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
FASTMCP_SHOW_SERVER_BANNER=false \
FASTMCP_CHECK_FOR_UPDATES=off \
FASTMCP_ENABLE_RICH_LOGGING=false \
DOCKSTORE_MCP_TRANSPORT=http \
DOCKSTORE_MCP_HOST=0.0.0.0 \
DOCKSTORE_MCP_PORT=8000 \
DOCKSTORE_MCP_PATH=/mcp \
DOCKSTORE_MCP_DOCKSTORE_URL=https://dockstore.org \
DOCKSTORE_MCP_GIT_REF=${GIT_REF}
USER dockstore
WORKDIR /home/dockstore
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["python", "-c", "import os, urllib.request; urllib.request.urlopen('http://127.0.0.1:' + os.environ.get('DOCKSTORE_MCP_PORT', '8000') + '/health').read()"]
ENTRYPOINT ["dockstore-mcp"]