From c3e4e35c0896b91119bacd40288c3e4964f55b3f Mon Sep 17 00:00:00 2001 From: Paolo Viotti Date: Sun, 10 Mar 2024 22:45:06 +0000 Subject: [PATCH] docker: back to alpine image --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6687f80..07cf5c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ -FROM golang:1.22 +FROM golang:1.22-alpine AS builder WORKDIR /app +RUN apk add --update --no-cache gcc musl-dev + COPY go.mod . COPY go.sum . RUN go mod download && go mod verify @@ -9,8 +11,14 @@ RUN go mod download && go mod verify COPY . . RUN go build -o pocket-counter . +FROM alpine:3.19 + +WORKDIR /app + VOLUME /app/data +COPY --from=builder /app/pocket-counter . + EXPOSE 8080 CMD ["./pocket-counter"] \ No newline at end of file