-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (64 loc) · 4.44 KB
/
Dockerfile
File metadata and controls
78 lines (64 loc) · 4.44 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# syntax=docker/dockerfile:1
# ▄▄▄▄ █ ██ ██▓ ██▓ ▓█████▄ ▓█████ ██▀███
# ▓█████▄ ██ ▓██▒▓██▒▓██▒ ▒██▀ ██▌▓█ ▀ ▓██ ▒ ██▒
# ▒██▒ ▄██▓██ ▒██░▒██▒▒██░ ░██ █▌▒███ ▓██ ░▄█ ▒
# ▒██░█▀ ▓▓█ ░██░░██░▒██░ ░▓█▄ ▌▒▓█ ▄ ▒██▀▀█▄
# ░▓█ ▀█▓▒▒█████▓ ░██░░██████▒░▒████▓ ░▒████▒░██▓ ▒██▒
# ░▒▓███▀▒░▒▓▒ ▒ ▒ ░▓ ░ ▒░▓ ░ ▒▒▓ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░
# ▒░▒ ░ ░░▒░ ░ ░ ▒ ░░ ░ ▒ ░ ░ ▒ ▒ ░ ░ ░ ░▒ ░ ▒░
# ░ ░ ░░░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░░ ░
# ░ ░ ░ ░ ░ ░ ░ ░ ░
# ░ ░
#
FROM golang:1.26-alpine AS builder
WORKDIR /usr/src/mcp
COPY --chown=root:root . /usr/src/mcp
ARG BUILD_VERSION=dev
RUN apk add --no-cache git
RUN go mod download
RUN go build -ldflags="-X 'github.com/teamwork/mcp/internal/config.Version=$BUILD_VERSION'" -o /app/tw-mcp-http ./cmd/mcp-http
RUN go build -ldflags="-X 'github.com/teamwork/mcp/internal/config.Version=$BUILD_VERSION'" -o /app/tw-mcp-stdio ./cmd/mcp-stdio
# ██▀███ █ ██ ███▄ █ ███▄ █ ▓█████ ██▀███
# ▓██ ▒ ██▒ ██ ▓██▒ ██ ▀█ █ ██ ▀█ █ ▓█ ▀ ▓██ ▒ ██▒
# ▓██ ░▄█ ▒▓██ ▒██░▓██ ▀█ ██▒▓██ ▀█ ██▒▒███ ▓██ ░▄█ ▒
# ▒██▀▀█▄ ▓▓█ ░██░▓██▒ ▐▌██▒▓██▒ ▐▌██▒▒▓█ ▄ ▒██▀▀█▄
# ░██▓ ▒██▒▒▒█████▓ ▒██░ ▓██░▒██░ ▓██░░▒████▒░██▓ ▒██▒
# ░ ▒▓ ░▒▓░░▒▓▒ ▒ ▒ ░ ▒░ ▒ ▒ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░
# ░▒ ░ ▒░░░▒░ ░ ░ ░ ░░ ░ ▒░░ ░░ ░ ▒░ ░ ░ ░ ░▒ ░ ▒░
# ░░ ░ ░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░
# ░ ░ ░ ░ ░ ░ ░
#
FROM alpine:3 AS runner
COPY --from=builder /app/tw-mcp-http /bin/tw-mcp-http
COPY --from=builder /app/tw-mcp-stdio /bin/tw-mcp-stdio
# Set permissions for the binaries
RUN addgroup -S mcp && adduser -S mcp -G mcp
RUN chown mcp:mcp /bin/tw-mcp-http /bin/tw-mcp-stdio && chmod 0755 /bin/tw-mcp-http /bin/tw-mcp-stdio
USER mcp
ARG BUILD_DATE
ARG BUILD_VCS_REF
ARG BUILD_VERSION
ENV TW_MCP_VERSION=$BUILD_VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="Teamwork.com MCP server" \
org.label-schema.name="mcp" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://github.com/teamwork/mcp" \
org.label-schema.vcs-url="https://github.com/teamwork/mcp" \
org.label-schema.vcs-ref=$BUILD_VCS_REF \
org.label-schema.vendor="Teamwork.com" \
org.label-schema.version=$BUILD_VERSION \
io.modelcontextprotocol.server.name="com.teamwork/mcp"
ENTRYPOINT [ "/bin/tw-mcp-http" ]
# ██████ ▄▄▄█████▓▓█████▄ ██▓ ▒█████
# ▒██ ▒ ▓ ██▒ ▓▒▒██▀ ██▌▓██▒▒██▒ ██▒
# ░ ▓██▄ ▒ ▓██░ ▒░░██ █▌▒██▒▒██░ ██▒
# ▒ ██▒░ ▓██▓ ░ ░▓█▄ ▌░██░▒██ ██░
# ▒██████▒▒ ▒██▒ ░ ░▒████▓ ░██░░ ████▓▒░
# ▒ ▒▓▒ ▒ ░ ▒ ░░ ▒▒▓ ▒ ░▓ ░ ▒░▒░▒░
# ░ ░▒ ░ ░ ░ ░ ▒ ▒ ▒ ░ ░ ▒ ▒░
# ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ▒
# ░ ░ ░ ░ ░
# ░
FROM runner AS stdio
ENTRYPOINT [ "/bin/tw-mcp-stdio" ]