mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 10:10:46 +08:00
32 lines
427 B
Text
32 lines
427 B
Text
|
#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"]
|
||
|
|