From 140a4e876d2c88d591d87b1d5a35038262fac3a7 Mon Sep 17 00:00:00 2001 From: Stan Rozenraukh Date: Sat, 29 Jun 2024 11:24:50 -0400 Subject: [PATCH] working Dockerfile --- Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c861568..15cf413 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ - FROM oven/bun:1.1 as tw WORKDIR /app COPY package.json bun.lockb ./ @@ -8,14 +7,14 @@ RUN bun run tailwindcss -i ./static/input.css -o styles.css --minify FROM golang:1.22.0 as app -ENV GOARCH=amd64 -ENV GOOS=linux WORKDIR /app COPY go.mod go.sum ./ RUN go mod download -COPY . . -ARG VERSION_SHA +COPY . . +ARG VERSION_SHA=unspecified +ENV GOOS=linux +ENV GOARCH=amd64 RUN go build -o server -ldflags="-X main.version=$VERSION_SHA" ./cmd/veun FROM scratch as prod @@ -24,6 +23,4 @@ COPY --from=app /app/server /app COPY --from=app /app/static /static COPY --from=tw /app/styles.css /static/styles.css -ENTRYPOINT ["/app"] - -CMD [ "serve" ] +ENTRYPOINT ["/app", "serve"]