Update Dockerfile

This commit is contained in:
Alterem 2024-05-16 23:17:10 +08:00 committed by GitHub
parent 4d80b12220
commit a1bb532b34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

View File

@ -1,11 +1,17 @@
FROM golang:latest
FROM golang:1.21-alpine AS builder
WORKDIR $GOPATH/override
ADD . $GOPATH/override
RUN go build .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o override
FROM alpine:latest
COPY --from=builder $GOPATH/override /usr/local/bin/override
WORKDIR /app
EXPOSE 8181
ENTRYPOINT ["./override"]
ENTRYPOINT ["/usr/local/bin/override"]