-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multi-stage builds for Management & Treatment Services Docker…
…file (#66) * Update management dockerfile * Make binary executable * Add multi-stage build * Update workflow versions * Update Treatment Service Dockerfile and deps * Make Management Service Dockerfile multi-step build * Remove binary download step in release workflow * Copy API specs * Standardize schema file copy * Address PR comments
- Loading branch information
1 parent
69c6158
commit 12e2691
Showing
6 changed files
with
56 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
FROM alpine:latest | ||
FROM golang:1.18-alpine as api-builder | ||
ARG API_BIN_NAME=xp-treatment | ||
|
||
RUN apk update && apk add musl-dev gcc | ||
|
||
ENV GO111MODULE=on \ | ||
GOOS=linux \ | ||
GOARCH=amd64 | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN apk update && apk add git make bash unzip libtool gcc musl-dev ca-certificates dumb-init tzdata | ||
# Build Treatment Service binary | ||
RUN go build \ | ||
-mod=vendor \ | ||
-tags musl \ | ||
-o ./bin/${API_BIN_NAME} | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk update && apk add git make bash unzip libtool ca-certificates dumb-init tzdata | ||
RUN mkdir -p /opt/xp_treatment | ||
|
||
COPY . /opt/xp_treatment/ | ||
COPY ./bin/* /opt/xp_treatment/ | ||
COPY --from=api-builder /app/bin/* /opt/xp_treatment/ | ||
|
||
WORKDIR /opt/xp_treatment | ||
ENTRYPOINT [ "./xp-treatment" ] | ||
|
||
ARG API_BIN_NAME=xp-treatment | ||
ENV XP_API_BIN "./${API_BIN_NAME}" | ||
|
||
ENTRYPOINT ["sh", "-c", "${XP_API_BIN} \"$@\"", "--"] |
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