-
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.
Merge pull request #43 from sapawarga/enhancement/docker-setting-env
Enhancement/docker setting env
- Loading branch information
Showing
9 changed files
with
60 additions
and
88 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 |
---|---|---|
|
@@ -11,28 +11,17 @@ WORKDIR /build | |
|
||
COPY go.mod . | ||
COPY go.sum . | ||
COPY .env.example ./.env | ||
RUN go mod download | ||
RUN go mod download -x | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 go test -v ./... | ||
RUN make build | ||
|
||
FROM alpine:3.11.3 as run-image | ||
FROM gcr.io/distroless/base-debian10 | ||
|
||
LABEL maintainer="GoSapawarga <[email protected]>" | ||
|
||
ENV PROJECT_PATH=/build | ||
COPY --from=compile-image /build / | ||
|
||
WORKDIR /app | ||
|
||
RUN apk --update add tzdata ca-certificates && \ | ||
update-ca-certificates 2>/dev/null || true | ||
|
||
COPY --from=compile-image ${PROJECT_PATH}/userpost-service /app/userpost-service | ||
COPY --from=compile-image ${PROJECT_PATH}/.env /app/.env | ||
|
||
EXPOSE 3002 3003 | ||
|
||
ENTRYPOINT [ "/app/userpost-service" ] | ||
ENTRYPOINT [ "/userpost-service" ] |
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
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
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
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
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
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
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
Oops, something went wrong.