Skip to content

Commit

Permalink
Update Treatment Service Dockerfile and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyylim committed Mar 10, 2023
1 parent 6752273 commit 3594e17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ build-management-service: version

build-treatment-service: version
@echo "Building binary..."
@cd ${TREATMENT_SVC_PATH} && go build -o ./bin/${TREATMENT_SVC_BIN_NAME}
@cd ${TREATMENT_SVC_PATH} && go build -tags musl -o ./bin/${TREATMENT_SVC_BIN_NAME}
@cp api/treatment.yaml ${TREATMENT_SVC_PATH}/bin
@cp api/schema.yaml ${TREATMENT_SVC_PATH}/bin

Expand Down
7 changes: 2 additions & 5 deletions treatment-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@ ENV GO111MODULE=on \
GOOS=linux \
GOARCH=amd64

ENV PROJECT_ROOT=github.com/caraml-dev/xp/treatment-service

WORKDIR /app
COPY . .

# Build Treatment Service binary
RUN go build \
-mod=vendor \
-tags musl \
-o ./bin/${API_BIN_NAME} \
-v ${PROJECT_ROOT}/cmd
-o ./bin/${API_BIN_NAME}

FROM alpine:latest

RUN apk update && apk add git make bash unzip libtool gcc musl-dev ca-certificates dumb-init tzdata
RUN apk update && apk add git make bash unzip libtool ca-certificates dumb-init tzdata
RUN mkdir -p /opt/xp_treatment

COPY --from=api-builder /app/bin/* /opt/xp_treatment/
Expand Down
2 changes: 1 addition & 1 deletion treatment-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ version:

build-treatment-service: version
@echo "Building binary..."
@cd ${TREATMENT_SVC_PATH} && go build -o ./bin/${TREATMENT_SVC_BIN_NAME}
@go build -tags musl -o ./bin/${TREATMENT_SVC_BIN_NAME}
@cp api/treatment.yaml ${TREATMENT_SVC_PATH}/bin
@cp api/schema.yaml ${TREATMENT_SVC_PATH}/bin

Expand Down

0 comments on commit 3594e17

Please sign in to comment.