-
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
Showing
1 changed file
with
11 additions
and
6 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,24 @@ | ||
FROM golang:alpine AS builder | ||
|
||
ENV GO1225MODULE=on \ | ||
ENV GO111MODULE=on \ | ||
CGO_ENABLED=0 \ | ||
GOOS=linux \ | ||
GOARCH=amd64 | ||
|
||
WORKDIR /build | ||
COPY go.mod go.sum main.go ./ | ||
|
||
COPY go.mod go.sum ./cmd/main.go ./ | ||
|
||
RUN go mod download | ||
RUN go build -o main . | ||
RUN go build -o techbloghub-server . | ||
|
||
WORKDIR /dist | ||
RUN cp /build/main . | ||
|
||
RUN cp /build/techbloghub-server . | ||
|
||
FROM scratch | ||
COPY --from=builder /dist/main . | ||
ENTRYPOINT ["/techbloghub"] | ||
|
||
COPY --from=builder /dist/techbloghub-server /techbloghub-server | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/techbloghub-server"] |