Skip to content

Commit c4c3a24

Browse files
committed
feat: update Docker build configuration to support multi-architecture images and add Dockerfile for MCP Server
1 parent c1332d1 commit c4c3a24

File tree

5 files changed

+57
-30
lines changed

5 files changed

+57
-30
lines changed

.dockerignore

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/docker-build.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Push Docker Image
1+
name: Build and Push Docker Images
22

33
on:
44
push:
@@ -7,12 +7,19 @@ on:
77

88
jobs:
99
build:
10-
name: Build and Push Multi-Arch Image
10+
name: Build and Push Multi-Arch Images
1111
runs-on: ubuntu-latest
12-
1312
permissions:
1413
contents: read
1514
packages: write
15+
16+
strategy:
17+
matrix:
18+
service: [
19+
{name: 'paperless-export-api', dockerfile: 'Dockerfile'},
20+
{name: 'paperless-export-mcp-server-sse', dockerfile: 'Dockerfile.McpServer.SSE'},
21+
{name: 'paperless-export-mcp-server', dockerfile: 'Dockerfile.McpServer'},
22+
]
1623

1724
steps:
1825
- name: Checkout code
@@ -38,8 +45,9 @@ jobs:
3845
uses: docker/build-push-action@v5
3946
with:
4047
context: .
48+
file: ${{ matrix.service.dockerfile }}
4149
push: true
4250
platforms: linux/amd64,linux/arm64
4351
tags: |
44-
mctristan/paperless-export-api:latest
45-
mctristan/paperless-export-api:${{ env.VERSION }}
52+
mctristan/${{ matrix.service.name }}:latest
53+
mctristan/${{ matrix.service.name }}:${{ env.VERSION }}

Dockerfile.McpServer

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
2+
USER $APP_UID
3+
WORKDIR /app
4+
5+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
6+
ARG BUILD_CONFIGURATION=Release
7+
WORKDIR /src
8+
COPY ["ExportPaperless.McpServer/ExportPaperless.McpServer.csproj", "ExportPaperless.McpServer/"]
9+
RUN dotnet restore "ExportPaperless.McpServer/ExportPaperless.McpServer.csproj"
10+
COPY . .
11+
WORKDIR "/src/ExportPaperless.McpServer"
12+
RUN dotnet build "./ExportPaperless.McpServer.csproj" -c $BUILD_CONFIGURATION -o /app/build
13+
14+
FROM build AS publish
15+
ARG BUILD_CONFIGURATION=Release
16+
RUN dotnet publish "./ExportPaperless.McpServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
17+
18+
FROM base AS final
19+
WORKDIR /app
20+
COPY --from=publish /app/publish .
21+
ENTRYPOINT ["dotnet", "ExportPaperless.McpServer.dll"]

Dockerfile.McpServer.SSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
2+
USER $APP_UID
3+
WORKDIR /app
4+
EXPOSE 5225
5+
6+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
7+
ARG BUILD_CONFIGURATION=Release
8+
WORKDIR /src
9+
COPY ["ExportPaperless.McpServer.SSE/ExportPaperless.McpServer.SSE.csproj", "ExportPaperless.McpServer.SSE/"]
10+
RUN dotnet restore "ExportPaperless.McpServer.SSE/ExportPaperless.McpServer.SSE.csproj"
11+
COPY . .
12+
WORKDIR "/src/ExportPaperless.McpServer.SSE"
13+
RUN dotnet build "./ExportPaperless.McpServer.SSE.csproj" -c $BUILD_CONFIGURATION -o /app/build
14+
15+
FROM build AS publish
16+
ARG BUILD_CONFIGURATION=Release
17+
RUN dotnet publish "./ExportPaperless.McpServer.SSE.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
18+
19+
FROM base AS final
20+
WORKDIR /app
21+
COPY --from=publish /app/publish .
22+
ENTRYPOINT ["dotnet", "ExportPaperless.McpServer.SSE.dll"]

ExportPaperless.McpServer/ExportPaperless.McpServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
89
</PropertyGroup>
910

1011
<ItemGroup>

0 commit comments

Comments
 (0)