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
|
RUN apk add --no-cache git build-base
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
RUN make
|
||||||
ENV GOOS=linux
|
|
||||||
ENV GOARCH=amd64
|
|
||||||
|
|
||||||
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 /usr/local/bin/fes
|
||||||
|
|
||||||
COPY --from=builder /src/fes /fes
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 3000
|
||||||
|
|
||||||
ENTRYPOINT ["/fes"]
|
ENTRYPOINT ["/usr/local/bin/fes"]
|
||||||
CMD ["run", "/app"]
|
CMD ["run", "/app"]
|
||||||
|
|||||||
Reference in New Issue
Block a user