Spaces:
Build error
Build error
Update Dockerfile
Browse files- 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
|
| 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 |
-
|
| 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"]
|