Dockerfile 740 B

1234567891011121314151617181920212223242526
  1. # syntax=docker/dockerfile:1
  2. FROM golang:1.20-alpine as builder
  3. WORKDIR /go/src/lcfns
  4. COPY . .
  5. RUN go env -w GO111MODULE=on \
  6. && go env -w GOPROXY=https://goproxy.cn,direct \
  7. && go env -w CGO_ENABLED=0 \
  8. && go env \
  9. && go mod tidy \
  10. && go build -o /go/src/lcfns/server .
  11. FROM alpine:latest
  12. LABEL authors="longan"
  13. WORKDIR /go/src/lcfns
  14. COPY --from=0 /go/src/lcfns/server ./
  15. COPY --from=0 /go/src/lcfns/config.docker.yaml ./
  16. RUN chmod 0644 /go/src/lcfns/config.docker.yaml && chmod 0644 /go/src/lcfns/server
  17. # web服务端口
  18. EXPOSE 8889
  19. #事件服务端口
  20. EXPOSE 8850
  21. #网关服务端口
  22. EXPOSE 9001
  23. #ENTRYPOINT /go/src/lcfns/server -c config.docker.yaml
  24. ENTRYPOINT ["/go/src/lcfns/server", "-c", "config.docker.yaml"]