From 97b0a6cc69d92a085d57ea4e5f91cc44ef7477d3 Mon Sep 17 00:00:00 2001 From: Alex Pliutau Date: Mon, 12 Aug 2024 22:03:27 +0200 Subject: [PATCH] Alpine Dockerfile --- api/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index b62dfc7..7ed06c5 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,6 @@ -FROM golang:1.22-bookworm AS builder +FROM golang:1.22-alpine AS builder + +RUN apk add build-base WORKDIR /root @@ -13,9 +15,10 @@ COPY ./migrations ./migrations COPY ./surveys ./surveys-examples RUN CGO_ENABLED=1 GOOS=linux go build -o api -tags enablecgo cmd/console-api/api.go -FROM debian:bookworm +FROM alpine:latest +RUN apk --no-cache add ca-certificates tzdata bash WORKDIR /root -COPY --from=builder /root/api . +COPY --from=builder /root/api ./api COPY --from=builder /root/migrations ./migrations COPY --from=builder /root/surveys-examples ./surveys-examples