mirror of
https://github.com/arkorty/Reduce.git
synced 2026-03-17 16:41:42 +00:00
24 lines
371 B
Docker
24 lines
371 B
Docker
FROM golang:1.21-alpine AS builder
|
|
|
|
RUN apk add --no-cache gcc musl-dev
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=1 \
|
|
CGO_CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" \
|
|
CGO_LDFLAGS="-lm" \
|
|
go build -ldflags="-s -w" .
|
|
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /app/reduce /reduce
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["/reduce"]
|