-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 712 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 712 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
# Build stage
FROM golang:1.26-alpine AS builder
# Install build dependencies
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
# Install Go dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build CLI and Server binary
RUN CGO_ENABLED=1 GOOS=linux go build -o mindloop main.go
# Final stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache libc6-compat ca-certificates
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/mindloop /usr/local/bin/mindloop
# Expose the default port
EXPOSE 8765
# Set the entrypoint to the mindloop binary
ENTRYPOINT ["mindloop"]
# Default arguments to start the server
CMD ["server", "--port=8765"]