mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 01:54:34 +08:00
31 lines
427 B
Docker
31 lines
427 B
Docker
#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"]
|
|
|