# Stage 1: Build the Go binary FROM golang:1.24-alpine AS builder WORKDIR /app # Copy go.mod and go.sum first COPY go.mod go.sum ./ RUN go mod download # Copy the rest of the code COPY . . # Build the Go binary RUN go build -o wagfarm-api main.go # Stage 2: Minimal runtime image FROM alpine:latest RUN apk add curl WORKDIR /root/ # Copy the binary from the builder COPY --from=builder /app/wagfarm-api . # Run the binary CMD ["./wagfarm-api"] #CMD ["tail", "-f", "/dev/null"]