-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (46 loc) · 1.84 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (46 loc) · 1.84 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
# Multi-stage build for pixel-mcp server
# Stage 1: Build the Go binary
FROM golang:1.24.1-alpine AS builder
WORKDIR /build
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o pixel-mcp ./cmd/pixel-mcp
# Stage 2: Runtime image with Aseprite
FROM ubuntu:22.04
LABEL org.opencontainers.image.source=https://github.com/willibrandon/pixel-mcp
LABEL org.opencontainers.image.description="MCP server for Aseprite pixel art and animation capabilities"
LABEL org.opencontainers.image.licenses=MIT
LABEL io.modelcontextprotocol.server.name="io.github.willibrandon/pixel-mcp"
# Install runtime dependencies for Aseprite
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libx11-6 \
libxcursor1 \
libxi6 \
libxrandr2 \
libgl1 \
libfontconfig1 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the Go binary from builder
COPY --from=builder /build/pixel-mcp /usr/local/bin/pixel-mcp
# Create necessary directories
RUN mkdir -p /tmp/pixel-mcp /root/.config/pixel-mcp
# Note: Aseprite binary must be provided via:
# 1. Build arg: --build-arg ASEPRITE_SOURCE=<path-to-aseprite>
# 2. Volume mount: -v /path/to/aseprite:/usr/local/bin/aseprite
# 3. Or copy from CI image (see Dockerfile.with-aseprite)
# Default environment variables (can be overridden)
ENV ASEPRITE_PATH=/usr/local/bin/aseprite
ENV TEMP_DIR=/tmp/pixel-mcp
ENV TIMEOUT=30
ENV LOG_LEVEL=info
# Generate default config file at runtime if not provided
RUN printf '{\n "aseprite_path": "%s",\n "temp_dir": "%s",\n "timeout": %d,\n "log_level": "%s"\n}\n' \
"$ASEPRITE_PATH" "$TEMP_DIR" "$TIMEOUT" "$LOG_LEVEL" \
> /root/.config/pixel-mcp/config.json
# MCP servers communicate over stdio
ENTRYPOINT ["/usr/local/bin/pixel-mcp"]