-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 1.64 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (50 loc) · 1.64 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
# Stage 1: Build the React frontend SPA
FROM node:22-alpine AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Build the C# application
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /source
ENV CI=true
# Copy csproj, props and restore dependencies
COPY mcp-router.csproj Directory.Build.props ./
RUN dotnet restore mcp-router.csproj
# Copy source and publish
COPY . ./
# Copy built frontend assets to wwwroot
COPY --from=frontend-build /wwwroot ./wwwroot
RUN dotnet publish mcp-router.csproj -c Release -o /app
# 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
RUN apt-get update && apt-get install -y --no-install-recommends \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy the published app
COPY --from=build /app .
# Expose port
EXPOSE 8080
# Environment variables
ENV ASPNETCORE_URLS=http://+:8080 \
ASPNETCORE_ENVIRONMENT=Production
# 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