-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.12 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
# Build stage
FROM rust:1.92.0-bookworm AS builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
perl \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy source files
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY crates/ crates/
# Build the release binary
RUN cargo build --release --package apollo-mcp-server --bin apollo-mcp-server
# Runtime stage - minimal image with just glibc
# Using distroless/cc which includes glibc and CA certificates
FROM gcr.io/distroless/cc-debian12
# MCP Registry annotation for publishing
LABEL io.modelcontextprotocol.server.name="io.github.apollographql/apollo-mcp-server"
# Copy the binary
COPY --from=builder /app/target/release/apollo-mcp-server /usr/local/bin/apollo-mcp-server
# Create /data directory
# WORKDIR creates the directory if it doesn't exist
WORKDIR /data
# Environment variables
ENV APOLLO_MCP_TRANSPORT__TYPE=streamable_http
ENV APOLLO_MCP_TRANSPORT__ADDRESS=0.0.0.0
# Expose port
EXPOSE 8000/tcp
# Run as non-root user
USER 1000:1000
# Entrypoint and Cmd
ENTRYPOINT ["apollo-mcp-server"]
CMD ["/dev/null"]