Browse Source

添加 'gowork/dockerfile_api'

master
sunyue 1 year ago
parent
commit
e587605cbd
  1. 19
      gowork/dockerfile_api

19
gowork/dockerfile_api

@ -0,0 +1,19 @@
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/golang:2.22-06-22
WORKDIR /app/
COPY . .
RUN unset GOPROXY
RUN go env -w GOPROXY=https://goproxy.cn
RUN go env -w GO111MODULE=on
RUN CGO_ENABLED=0 go build -ldflags "-extldflags -static " -tags netgo -a -v -o missionBoard main.go
FROM repository.anxinyun.cn/devops/alpine:3-tz-hw
RUN apk update && apk add tzdata
WORKDIR /usr/local/bin
COPY --from=0 /app/conf.ini /usr/local/bin
COPY --from=0 /app/missionBoard /usr/local/bin
EXPOSE 8080
RUN chmod +x /usr/local/bin/missionBoard
CMD ["missionBoard"]
Loading…
Cancel
Save