Skip to content

Commit

Permalink
fix(deployment): rebuild image
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 22, 2024
1 parent f3354fc commit 03c58f5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/save-notes.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/save-notes/
file: ./backend/complex/save-notes/Dockerfile
file: ./backend/complex/save-notes/SaveNotes.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:save-notes
platforms: linux/arm64
2 changes: 1 addition & 1 deletion .github/workflows/view-notes.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/view-notes/
file: ./backend/complex/view-notes/Dockerfile
file: ./backend/complex/view-notes/ViewNotes.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:view-notes
platforms: linux/arm64
1 change: 1 addition & 0 deletions backend/complex/process-chunks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN pyinstaller \
--hidden-import=tiktoken_ext \
--onefile main.py


FROM debian:stable-slim
WORKDIR /app
COPY --from=builder /app/dist/main server
Expand Down
30 changes: 30 additions & 0 deletions backend/complex/save-notes/SaveNotes.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM developwithzt/esd-buf-healthprobe-base:general-1.0 as proto-base
COPY buf.* .
COPY protos/ protos/
RUN buf generate

FROM python:3.11.7 as builder
WORKDIR /app
RUN pip install pyinstaller
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --from=proto-base /app/pb/ /app/pb/
ENV PYTHONPATH /app/:/app/pb/:$PYTHONPATH
COPY src/ src/
RUN pyinstaller --onefile src/main.py

FROM debian:stable-slim
WORKDIR /app

# Install curl and other necessary utilities
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*

# Download and install the gRPC health probe, used for checking the health of gRPC applications
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=builder /app/dist/main server
CMD ["./server"]
1 change: 1 addition & 0 deletions backend/complex/upload-notes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN mvn dependency:go-offline
COPY src /app/src
RUN mvn clean package -DskipTests


FROM maven:3.9.6-amazoncorretto-17-debian AS jlink
RUN apt-get update && apt-get install -y binutils
RUN jlink --no-header-files \
Expand Down
30 changes: 30 additions & 0 deletions backend/complex/view-notes/ViewNotes.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM developwithzt/esd-buf-healthprobe-base:general-1.0 as proto-base
COPY buf.* .
COPY protos/ protos/
RUN buf generate

FROM python:3.11.7 as builder
WORKDIR /app
RUN pip install pyinstaller
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --from=proto-base /app/pb/ /app/pb/
ENV PYTHONPATH /app/:/app/pb/:$PYTHONPATH
COPY src/ src/
RUN pyinstaller --onefile src/main.py

FROM debian:stable-slim
WORKDIR /app

# Install curl and other necessary utilities
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*

# Download and install the gRPC health probe, used for checking the health of gRPC applications
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=builder /app/dist/main server
CMD ["./server"]

0 comments on commit 03c58f5

Please sign in to comment.