Skip to content

Commit

Permalink
fix(payment): rebuild image
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 22, 2024
1 parent 1db0413 commit c07936b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/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/simple/payment/
file: ./backend/simple/payment/Dockerfile
file: ./backend/simple/payment/Payment.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:payment
platforms: linux/arm64
31 changes: 31 additions & 0 deletions backend/simple/payment/Payment.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM developwithzt/esd-buf-healthprobe-base:general-1.0 as proto-base
COPY buf.* .
COPY protos/ protos/
RUN buf generate

FROM ruby:3.3.0-slim as builder
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle install && \
rm -rf /usr/local/bundle/cache/*.gem && \
find /usr/local/bundle/gems/ -name "*.c" -delete && \
find /usr/local/bundle/gems/ -name "*.o" -delete

FROM ruby:3.3.0-slim
WORKDIR /app
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
COPY --from=builder /app/Gemfile* /app/Gemfile*

RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

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

COPY --from=proto-base /app/pb/ /app/pb/
COPY src/ src/
CMD ["ruby", "src/server.rb"]

0 comments on commit c07936b

Please sign in to comment.