Skip to content

Commit c960b38

Browse files
Add Dockerfile and .dockerignore for containerized deployment (#48)
Multi-stage Alpine build: fetches dependencies first for layer caching, then builds the release binary. Runtime image is minimal Alpine with ca-certificates and tzdata.
1 parent ae82c1a commit c960b38

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
target
2+
.claude/
3+
.vscode/
4+
.github/
5+
docs/
6+
**/node_modules
7+
**/dist
8+
**/coverage
9+
*.log
10+
Dockerfile
11+
docker-compose.yml

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM rust:1.91.1-alpine AS builder
2+
WORKDIR /app
3+
4+
# Build
5+
6+
RUN apk update && apk add --no-cache pkgconf openssl-dev openssl-libs-static
7+
8+
# Very ugly trick to fetch the dependencis without the need of actually copying the source code
9+
COPY Cargo.toml Cargo.lock ./
10+
COPY mcp-tools-codegen/Cargo.toml mcp-tools-codegen/Cargo.toml
11+
RUN mkdir -p src mcp-tools-codegen/src \
12+
&& echo 'fn main() {}' > src/main.rs \
13+
&& echo 'pub fn dummy() {}' > mcp-tools-codegen/src/lib.rs
14+
15+
RUN cargo fetch
16+
17+
COPY . .
18+
19+
RUN cargo build --release --bin mcp-for-azure-devops-boards
20+
21+
# Runtime
22+
23+
FROM alpine:3.22 AS runtime
24+
25+
LABEL com.github.actions.name="auto publish"
26+
LABEL com.github.actions.icon="package"
27+
LABEL com.github.actions.color="blue"
28+
29+
LABEL version="0.5.0"
30+
LABEL repository="https://github.com/danielealbano/mcp-for-azure-devops-boards"
31+
LABEL homepage="https://github.com/danielealbano/mcp-for-azure-devops-boards"
32+
LABEL maintainer="Daniele Salvatore Albano <d.albano@gmail.com>"
33+
34+
RUN apk update && apk add --no-cache ca-certificates tzdata
35+
36+
WORKDIR /app
37+
38+
COPY --from=builder /app/target/release/mcp-for-azure-devops-boards /usr/local/bin/mcp-for-azure-devops-boards
39+
40+
ENTRYPOINT ["mcp-for-azure-devops-boards"]

0 commit comments

Comments
 (0)