From 5ad03eeb67e55797fc1e18f0ae4090679160bb21 Mon Sep 17 00:00:00 2001 From: darius Date: Thu, 16 May 2024 20:43:34 +0200 Subject: [PATCH] docker fix --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e701929..8681787 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official Golang runtime as a parent image -FROM golang:latest +FROM golang:latest as build # Set the working directory to /app WORKDIR . @@ -9,11 +9,17 @@ COPY . . # Download and install any required dependencies RUN go mod download +# Generate orm +RUN go generate ./database/ent + # Build the Go app RUN go build . -# Generate orm -RUN go generate ./database/ent +FROM gcr.io/distroless/base-debian12 + +COPY --from=build /go/portfolio . + +ADD .env . # Expose port 8080 for incoming traffic EXPOSE 4000