rewrite Dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -4,24 +4,17 @@ WORKDIR /src
|
||||
|
||||
RUN apk add --no-cache git build-base
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=amd64
|
||||
RUN make
|
||||
|
||||
RUN go build -ldflags="-X fes/modules/version.gitCommit=$(git rev-parse --short HEAD) -s -w" -o fes
|
||||
FROM alpine:3.19
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /src/fes /fes
|
||||
COPY --from=builder /src/fes /usr/local/bin/fes
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
EXPOSE 8080
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["/fes"]
|
||||
ENTRYPOINT ["/usr/local/bin/fes"]
|
||||
CMD ["run", "/app"]
|
||||
|
||||
Reference in New Issue
Block a user