-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from docker/docker/servers
Add Docker support for sample mcp servers
- Loading branch information
Showing
50 changed files
with
1,108 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:22.12-alpine as builder | ||
|
||
COPY src/aws-kb-retrieval-server /app | ||
COPY tsconfig.json /tsconfig.json | ||
|
||
WORKDIR /app | ||
|
||
RUN --mount=type=cache,target=/root/.npm npm install | ||
|
||
FROM node:22-alpine AS release | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist /app/dist | ||
COPY --from=builder /app/package.json /app/package.json | ||
COPY --from=builder /app/package-lock.json /app/package-lock.json | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN npm ci --ignore-scripts --omit-dev | ||
|
||
ENTRYPOINT ["node", "dist/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM node:22.12-alpine as builder | ||
|
||
# Must be entire project because `prepare` script is run during `npm install` and requires all files. | ||
COPY src/brave-search /app | ||
COPY tsconfig.json /tsconfig.json | ||
|
||
WORKDIR /app | ||
|
||
RUN --mount=type=cache,target=/root/.npm npm install | ||
|
||
FROM node:22-alpine AS release | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist /app/dist | ||
COPY --from=builder /app/package.json /app/package.json | ||
COPY --from=builder /app/package-lock.json /app/package-lock.json | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN npm ci --ignore-scripts --omit-dev | ||
|
||
ENTRYPOINT ["node", "dist/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:22.12-alpine as builder | ||
|
||
COPY src/everart /app | ||
COPY tsconfig.json /tsconfig.json | ||
|
||
WORKDIR /app | ||
|
||
RUN --mount=type=cache,target=/root/.npm npm install | ||
|
||
FROM node:22-alpine AS release | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist /app/dist | ||
COPY --from=builder /app/package.json /app/package.json | ||
COPY --from=builder /app/package-lock.json /app/package-lock.json | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN npm ci --ignore-scripts --omit-dev | ||
|
||
ENTRYPOINT ["node", "dist/index.js"] | ||
|
||
CMD ["node", "dist/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:22.12-alpine as builder | ||
|
||
COPY src/everything /app | ||
COPY tsconfig.json /tsconfig.json | ||
|
||
WORKDIR /app | ||
|
||
RUN --mount=type=cache,target=/root/.npm npm install | ||
|
||
FROM node:22-alpine AS release | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist /app/dist | ||
COPY --from=builder /app/package.json /app/package.json | ||
COPY --from=builder /app/package-lock.json /app/package-lock.json | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN npm ci --ignore-scripts --omit-dev | ||
|
||
CMD ["node", "dist/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Use a Python image with uv pre-installed | ||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv | ||
|
||
# Install the project into `/app` | ||
WORKDIR /app | ||
|
||
# Enable bytecode compilation | ||
ENV UV_COMPILE_BYTECODE=1 | ||
|
||
# Copy from the cache instead of linking since it's a mounted volume | ||
ENV UV_LINK_MODE=copy | ||
|
||
# Install the project's dependencies using the lockfile and settings | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-install-project --no-dev --no-editable | ||
|
||
# Then, add the rest of the project source code and install it | ||
# Installing separately from its dependencies allows optimal layer caching | ||
ADD . /app | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv sync --frozen --no-dev --no-editable | ||
|
||
FROM python:3.12-slim-bookworm | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=uv /root/.local /root/.local | ||
COPY --from=uv --chown=app:app /app/.venv /app/.venv | ||
|
||
# Place executables in the environment at the front of the path | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
# when running the container, add --db-path and a bind mount to the host's db file | ||
ENTRYPOINT ["mcp-server-fetch"] |
Oops, something went wrong.