Skip to content

Commit 0c80094

Browse files
fsollezaaustinlparkerpuckpuck
authored
build protobuf in dockerfile for all services (#1386)
* generate protobuf in docker build for accountingservice, checkoutservice, currencyservice, and productcatalogservice * fix build context --------- Co-authored-by: Austin Parker <[email protected]> Co-authored-by: Pierre Tessier <[email protected]>
1 parent e82863b commit 0c80094

File tree

15 files changed

+31
-14202
lines changed

15 files changed

+31
-14202
lines changed

.github/workflows/build-images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
setup-qemu: true
5050
- file: ./src/currencyservice/Dockerfile
5151
tag_suffix: currencyservice
52-
context: ./src/currencyservice
52+
context: ./
5353
setup-qemu: true
5454
- file: ./src/emailservice/Dockerfile
5555
tag_suffix: emailservice

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ test/tracetesting/tracetesting-vars.yaml
5252
/src/paymentservice/demo.proto
5353
/src/recommendationservice/demo_pb2*.py
5454
/src/shippingservice/proto/
55+
/src/productcatalogservice/genproto
56+
/src/currencyservice/proto
57+
/src/checkoutservice/genproto
58+
/src/accountingservice/genproto

docker-compose.minimal.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ services:
126126
image: ${IMAGE_NAME}:${DEMO_VERSION}-currencyservice
127127
container_name: currency-service
128128
build:
129-
context: ./src/currencyservice
129+
context: ./
130+
dockerfile: ./src/currencyservice/Dockerfile
130131
cache_from:
131132
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
132133
deploy:

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ services:
157157
image: ${IMAGE_NAME}:${DEMO_VERSION}-currencyservice
158158
container_name: currency-service
159159
build:
160-
context: ./src/currencyservice
160+
context: ./
161+
dockerfile: ./src/currencyservice/Dockerfile
161162
cache_from:
162163
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
163164
deploy:

src/accountingservice/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33

44

55
FROM golang:1.22.0-alpine AS builder
6+
RUN apk update && apk add --no-cache make protobuf-dev
7+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
8+
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
9+
610
WORKDIR /usr/src/app/
711

812
COPY ./src/accountingservice/ ./
13+
COPY ./pb/ ./pb
14+
15+
RUN protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./
916
RUN go build -o /go/bin/accountingservice/
1017

1118
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)