16 lines
350 B
Docker
16 lines
350 B
Docker
# Stage 1: Build the Rod application
|
|
FROM golang AS builder
|
|
|
|
WORKDIR /app
|
|
COPY go.mod go.sum /app/
|
|
RUN go mod download
|
|
|
|
COPY *.go /app/
|
|
|
|
## RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
|
|
|
|
# Stage 2: Use a slim image for the runnable container
|
|
FROM alpine as runtime
|
|
WORKDIR /root/
|
|
COPY --from=builder /app/main .
|
|
CMD ["./main"] |