Skip to content

Commit 5fbb125

Browse files
committed
Fixing checkout service
1 parent 117d59c commit 5fbb125

File tree

4 files changed

+4651
-19
lines changed

4 files changed

+4651
-19
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@ test/tracetesting/tracetesting-vars.yaml
5555
/src/shippingservice/proto/
5656
/src/productcatalogservice/genproto
5757
/src/currencyservice/proto
58-
/src/checkoutservice/genproto
5958
/src/accountingservice/genproto

src/accountingservice/Dockerfile

+5-18
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,17 @@
33

44

55
FROM registry.ddbuild.io/images/mirror/golang:1.22-alpine AS builder
6+
WORKDIR /usr/src/app/
67

7-
WORKDIR /usr/src/app
8-
9-
RUN apk update \
10-
&& apk add --no-cache make protobuf-dev
11-
12-
RUN --mount=type=cache,target=/go/pkg/mod/ \
13-
--mount=type=bind,source=./src/accountingservice/go.sum,target=go.sum \
14-
--mount=type=bind,source=./src/accountingservice/go.mod,target=go.mod \
15-
--mount=type=bind,source=./src/accountingservice/tools.go,target=tools.go \
16-
go mod download \
17-
&& go list -e -f '{{range .Imports}}{{.}} {{end}}' tools.go | CGO_ENABLED=0 xargs go install -mod=readonly
8+
COPY ./src/accountingservice/ ./
9+
RUN go build -o /go/bin/accountingservice/
1810

19-
RUN --mount=type=cache,target=/go/pkg/mod/ \
20-
--mount=type=cache,target=/root/.cache/go-build \
21-
--mount=type=bind,rw,source=./src/accountingservice,target=. \
22-
--mount=type=bind,rw,source=./pb,target=./pb \
23-
protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./ \
24-
&& go build -ldflags "-s -w" -o /go/bin/accountingservice/ ./
11+
# -----------------------------------------------------------------------------
2512

2613
FROM alpine
2714

2815
WORKDIR /usr/src/app/
2916

3017
COPY --from=builder /go/bin/accountingservice/ ./
3118

32-
ENTRYPOINT [ "./accountingservice" ]
19+
ENTRYPOINT [ "./accountingservice" ]

0 commit comments

Comments
 (0)