Dockerfile 495 B

123456789101112131415161718192021
  1. FROM golang:latest as builder
  2. WORKDIR /app
  3. ENV GOPROXY https://goproxy.io
  4. COPY go.mod go.sum ./
  5. RUN go mod download
  6. COPY . .
  7. RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o livego .
  8. FROM alpine:latest
  9. RUN mkdir -p /app/config
  10. WORKDIR /app
  11. ENV RTMP_PORT 1935
  12. ENV HTTP_FLV_PORT 7001
  13. ENV HLS_PORT 7002
  14. ENV HTTP_OPERATION_PORT 8090
  15. COPY --from=builder /app/livego .
  16. EXPOSE ${RTMP_PORT}
  17. EXPOSE ${HTTP_FLV_PORT}
  18. EXPOSE ${HLS_PORT}
  19. EXPOSE ${HTTP_OPERATION_PORT}
  20. ENTRYPOINT ["./livego"]