log101-dot-dev-services/docker/go/Dockerfile

17 lines
394 B
Docker
Raw Normal View History

2024-06-02 08:44:39 +00:00
FROM golang:1.22.3-alpine as builder
2024-05-30 09:52:18 +00:00
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
2024-06-02 08:44:39 +00:00
RUN go build -v -o log101-dot-dev-services
2024-05-30 09:52:18 +00:00
2024-06-02 08:44:39 +00:00
FROM alpine
WORKDIR /root/app
COPY --from=builder /usr/src/app .
CMD ["./log101-dot-dev-services"]