# Builder stage FROM golang:1.22-alpine AS builder WORKDIR /app COPY go.mod go.sum ./ RUN go mod download COPY . . # Build the Go application RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/main . # Runtime stage FROM alpine:latest WORKDIR /app # Copy the static binary from the builder stage COPY --from=builder /app/main . # Expose the port your Go application listens on EXPOSE 8080 # Command to run the application ENTRYPOINT ["./main"]