Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract metadata (tags, labels) for standard Docker image
id: meta-standard
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
Expand All @@ -51,15 +51,42 @@ jobs:
type=ref,event=branch
type=sha

- name: Extract metadata (tags, labels) for full Docker image
id: meta-full
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-full,onlatest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || (github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') }}
type=ref,event=branch
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Build and push Docker image
- name: Build and push standard Docker image
uses: docker/build-push-action@v7
with:
context: .
target: runtime
push: true
tags: ${{ steps.meta-standard.outputs.tags }}
labels: ${{ steps.meta-standard.outputs.labels }}
cache-from: type=gha,scope=runtime
cache-to: type=gha,mode=max,scope=runtime

- name: Build and push full Docker image
uses: docker/build-push-action@v7
with:
context: .
target: runtime-full
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-full.outputs.tags }}
labels: ${{ steps.meta-full.outputs.labels }}
cache-from: type=gha,scope=runtime-full
cache-to: type=gha,mode=max,scope=runtime-full
22 changes: 20 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ COPY . ./
COPY --from=frontend-build /wwwroot ./wwwroot
RUN dotnet publish mcp-router.csproj -c Release -o /app

# Stage 3: Final runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
# Stage 3: Standard runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

# Install native dependencies for SQLite / SQLCipher bundle if any
Expand All @@ -42,3 +42,21 @@ ENV ASPNETCORE_URLS=http://+:8080 \

# Run the app
ENTRYPOINT ["dotnet", "mcp-router.dll"]

# Stage 4: "Batteries-Included" full runtime image for STDIO backends
FROM runtime AS runtime-full

# Install Python 3, Node.js, npm, ca-certificates, and curl
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
nodejs \
npm \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*

# Copy pre-compiled uv and bun binaries from official images
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
COPY --from=oven/bun:latest /usr/local/bin/bun /usr/local/bin/bun
Loading