-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (29 loc) · 1015 Bytes
/
Dockerfile
File metadata and controls
43 lines (29 loc) · 1015 Bytes
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
FROM golang:1.23-alpine AS builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache make git
# Copy go mod files from gorev-mcpserver directory
COPY gorev-mcpserver/go.mod gorev-mcpserver/go.sum ./
RUN go mod download
# Copy source code
COPY gorev-mcpserver/ .
# Build the binary (Web UI is pre-built and embedded)
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o gorev ./cmd/gorev
# Final stage
FROM alpine:latest
# Install ca-certificates for HTTPS calls
RUN apk add --no-cache ca-certificates && adduser -D -g '' gorev
# Create directories for data
RUN mkdir -p /workspace /data && chown -R gorev:gorev /workspace /data
# Copy the binary from builder
COPY --from=builder /app/gorev /usr/local/bin/gorev
# Switch to non-root user
USER gorev
# Set working directory
WORKDIR /workspace
# Default port
EXPOSE 5082
# Volume for persistent data
VOLUME ["/data", "/workspace"]
# Run server in foreground (daemon mode not suitable for containers)
CMD ["gorev", "serve", "--api-port", "5082"]