rentease/Dockerfile
2024-07-14 23:47:23 +02:00

23 lines
No EOL
377 B
Docker

FROM golang:1.22-alpine AS builder
RUN apk add --no-cache \
git \
build-base
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/dist/rentease main.go
FROM scratch
COPY --from=builder /app/dist/rentease /app/dist/rentease
WORKDIR /app
EXPOSE 8000
ENTRYPOINT ["/app/dist/rentease"]