-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66752ec
commit 8bc69a0
Showing
2 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Stage - Build | ||
FROM golang:alpine as build-env | ||
|
||
LABEL MAINTAINER Naveen Kumar Sangi <naveenkumarsangi@protonmail.com> | ||
|
||
RUN apk --no-cache add git | ||
ENV SOURCE /go/src/gitlab.com/nkprince007/listen | ||
RUN mkdir -p $SOURCE | ||
ADD . $SOURCE | ||
WORKDIR $SOURCE | ||
RUN mkdir -p /go/src/gitlab.com/nkprince007/listen | ||
ADD . /go/src/gitlab.com/nkprince007/listen | ||
WORKDIR /go/src/gitlab.com/nkprince007/listen | ||
|
||
RUN go get -v ./... | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w -s' -o listen . | ||
|
||
|
||
# Stage - Deploy | ||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add ca-certificates | ||
ENV SOURCE /go/src/gitlab.com/nkprince007/listen | ||
WORKDIR /root/ | ||
COPY --from=build-env $SOURCE . | ||
CMD ["./app"] | ||
COPY --from=build-env /go/src/gitlab.com/nkprince007/listen . | ||
|
||
CMD ["./listen"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters