Skip to content

Commit

Permalink
fix(makepayment & verifyuser): rebuild image
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 22, 2024
1 parent c0361dd commit 7c64faa
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/make-payment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ./backend/complex/make-payment/
file: ./backend/complex/make-payment/Dockerfile
file: ./backend/complex/make-payment/MakePayment.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:make-payment
platforms: linux/arm64
2 changes: 1 addition & 1 deletion .github/workflows/verify-user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ./backend/complex/verify-user/
file: ./backend/complex/verify-user/Dockerfile
file: ./backend/complex/verify-user/VerifyUser.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:verify-user
platforms: linux/arm64
28 changes: 28 additions & 0 deletions backend/complex/make-payment/MakePayment.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM developwithzt/esd-buf-healthprobe-base:go-1.0 as proto-base
COPY buf.* .
COPY api/ api/
RUN buf generate

FROM golang:alpine3.19 AS builder
WORKDIR /app

# Install curl to fetch grpc_health_probe
RUN apk --no-cache add curl

COPY go.mod go.sum ./
RUN go mod download
COPY --from=proto-base /app/pb/ pb/
COPY cmd/ cmd/
COPY internal/ internal/
RUN go build -o /app/build/server cmd/main.go

# Download and install the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \
curl -sLo /app/build/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64 && \
chmod +x /app/build/grpc_health_probe

FROM gcr.io/distroless/static-debian12
WORKDIR /app
COPY --from=builder /app/build/grpc_health_probe /bin/grpc_health_probe
COPY --from=builder /app/build/server .
CMD ["./server"]
28 changes: 28 additions & 0 deletions backend/complex/verify-user/VerifyUser.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM developwithzt/esd-buf-healthprobe-base:go-1.0 as proto-base
COPY buf.* .
COPY api/ api/
RUN buf generate

FROM golang:alpine3.19 AS builder
WORKDIR /app

# Install curl to fetch grpc_health_probe
RUN apk --no-cache add curl

COPY go.mod go.sum ./
RUN go mod download
COPY --from=proto-base /app/pb/ pb/
COPY cmd/ cmd/
COPY internal/ internal/
RUN go build -o /app/build/server cmd/main.go

# Download and install the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.13 && \
curl -sLo /app/build/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64 && \
chmod +x /app/build/grpc_health_probe

FROM gcr.io/distroless/static-debian12
WORKDIR /app
COPY --from=builder /app/build/grpc_health_probe /bin/grpc_health_probe
COPY --from=builder /app/build/server .
CMD ["./server"]

0 comments on commit 7c64faa

Please sign in to comment.