harvesthealth commited on
Commit
d12e9cd
·
verified ·
1 Parent(s): 21b35a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -6
Dockerfile CHANGED
@@ -8,19 +8,17 @@ WORKDIR /build
8
  RUN --mount=type=cache,target=/var/cache/apk \
9
  apk add git
10
 
11
- # Copy the modified github-mcp-server code
12
- COPY cmd/github-mcp-server/main.go /build/cmd/github-mcp-server/main.go
13
 
14
  # Fetch the required Go modules
15
  RUN --mount=type=cache,target=/go/pkg/mod \
16
  --mount=type=cache,target=/root/.cache/go-build \
17
- --mount=type=bind,target=. \
18
- go get github.com/mark3labs/mcp-go
19
 
20
  # Build the server
21
  RUN --mount=type=cache,target=/go/pkg/mod \
22
  --mount=type=cache,target=/root/.cache/go-build \
23
- --mount=type=bind,target=. \
24
  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)" \
25
  -o /bin/github-mcp-server cmd/github-mcp-server/main.go
26
 
@@ -49,4 +47,4 @@ RUN ls -la /usr/local/bin/github-mcp-server
49
  EXPOSE 7860
50
 
51
  # Run the web server
52
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
8
  RUN --mount=type=cache,target=/var/cache/apk \
9
  apk add git
10
 
11
+ # Copy the entire project structure to avoid read-only issues
12
+ COPY . .
13
 
14
  # Fetch the required Go modules
15
  RUN --mount=type=cache,target=/go/pkg/mod \
16
  --mount=type=cache,target=/root/.cache/go-build \
17
+ go mod tidy
 
18
 
19
  # Build the server
20
  RUN --mount=type=cache,target=/go/pkg/mod \
21
  --mount=type=cache,target=/root/.cache/go-build \
 
22
  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)" \
23
  -o /bin/github-mcp-server cmd/github-mcp-server/main.go
24
 
 
47
  EXPOSE 7860
48
 
49
  # Run the web server
50
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]