修复编译
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -1,20 +1,36 @@
|
||||
FROM node:alpine AS npm_builder
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update && apk add --no-cache pnpm
|
||||
|
||||
COPY ui ./ui
|
||||
RUN npm --prefix /app/ui install
|
||||
RUN npm --prefix /app/ui run build
|
||||
|
||||
RUN pnpm --prefix /app/ui install
|
||||
|
||||
RUN pnpm --prefix /app/ui run build
|
||||
|
||||
FROM golang:alpine AS go_builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update && apk add --no-cache git
|
||||
|
||||
COPY cmd ./cmd
|
||||
|
||||
COPY go.mod ./go.mod
|
||||
|
||||
COPY internal ./internal
|
||||
|
||||
COPY --from=npm_builder /app/ui/dist ./cmd/shokku/dist
|
||||
|
||||
RUN go get -d -v ./...
|
||||
|
||||
RUN go install -v ./...
|
||||
|
||||
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /go/bin/shokku ./cmd/shokku
|
||||
|
||||
FROM gcr.io/distroless/static:nonroot
|
||||
|
||||
COPY --from=go_builder /go/bin/shokku /go/bin/shokku
|
||||
|
||||
ENTRYPOINT ["/go/bin/shokku"]
|
||||
Reference in New Issue
Block a user