backend/app/brahma/api/murder/Dockerfile

21 lines
549 B
Docker
Raw Permalink Normal View History

2022-01-11 13:18:59 +08:00
FROM golang:1.17 as builder
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io,direct
WORKDIR /go/cache
ADD go.mod .
ADD go.sum .
RUN go mod download -x
WORKDIR /go/src
ADD . .
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_murder ./app/brahma/api/murder
FROM reg.icechen.cn/alpine as murder
WORKDIR /go/src
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /go/src/api_murder ./
ENV TZ=Asia/Shanghai
2022-01-14 20:01:15 +08:00
ENV ENDPOINTS=etcd.zeus:2379
2022-01-11 13:18:59 +08:00
RUN chmod +x ./api_murder
EXPOSE 8080
CMD ["./api_murder"]