Dockerfile 427 B

12345678910111213141516171819202122232425262728293031
  1. #first stage - builder
  2. FROM golang:1.14-stretch as builder
  3. COPY . /app
  4. WORKDIR /app
  5. ENV GO111MODULE=auto
  6. RUN CGO_ENABLED=0 GOOS=linux go build -o app main.go
  7. #second stage
  8. FROM alpine:latest
  9. WORKDIR /root/
  10. RUN apk add --no-cache tzdata
  11. COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
  12. COPY --from=builder /app .
  13. COPY --from=builder /app/config config
  14. EXPOSE 8081
  15. EXPOSE 50051
  16. CMD ["./app"]