-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 1.67 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
FROM golang:1.24.4-alpine AS build
ARG VERSION="dev"
# Set the working directory
WORKDIR /build
# コードコピー
COPY . /build
WORKDIR /build/github-mcp-server/cmd/github-mcp-server
# Install git
RUN --mount=type=cache,target=/var/cache/apk \
apk add git
# Build the server
# go build automatically download required module dependencies to /go/pkg/mod
# RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
# -o /bin/github-mcp-server /build/github-mcp-server/cmd/github-mcp-server/main.go
RUN go build -o /bin/github-mcp-server main.go
FROM condaforge/miniforge3
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /logs
# Node.js, npm, git, Dockerクライアントをインストール(conda環境切り替え前に実行)
RUN apt-get update --allow-insecure-repositories && \
apt-get install -y --allow-unauthenticated nodejs npm git docker.io && \
rm -rf /var/lib/apt/lists/*
# Python依存パッケージのインストール
COPY condaenv.yaml /tmp/condaenv.yaml
RUN conda env create -f /tmp/condaenv.yaml
SHELL ["conda", "run", "-n", "coding-agent", "/bin/bash", "-c"]
# 作業ディレクトリ
WORKDIR /app
# コードコピー
COPY . /app
# グローバルにmcp-gitlabをインストール
RUN npm install -g @zereight/mcp-gitlab@latest
# npxもグローバルにインストール(既存の場合は上書き)
RUN npm install -g npx --force
COPY --from=build /bin/github-mcp-server ./github-mcp-server.cmd
# conda環境でPythonスクリプトを実行するためのエントリーポイント
ENTRYPOINT ["conda", "run", "-n", "coding-agent", "--no-capture-output"]