netmaker/Dockerfile

32 lines
427 B
Text
Raw Normal View History

2021-03-26 00:17:52 +08:00
#first stage - builder
FROM golang:1.14-stretch as builder
COPY . /app
WORKDIR /app
ENV GO111MODULE=auto
RUN CGO_ENABLED=0 GOOS=linux go build -o app main.go
#second stage
FROM alpine:latest
WORKDIR /root/
RUN apk add --no-cache tzdata
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app .
COPY --from=builder /app/config config
EXPOSE 8081
EXPOSE 50051
CMD ["./app"]