forked from oreoslabs/oreowallet-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker containerization and image push gha
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target | ||
README.md | ||
Dockerfile | ||
target/CACHEDIR.TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Deploy Node Docker Image | ||
on: | ||
push: | ||
branches: | ||
'developer' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
Deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Login to AWS Registry | ||
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_REGISTRY_URL | ||
env: | ||
AWS_REGISTRY_URL: ${{ secrets.AWS_NODE_REGISTRY_URL }} | ||
|
||
- name: Build Node Image | ||
run: docker build -t oreowallet . | ||
|
||
- name: Deploy Node Image to AWS | ||
run: | | ||
docker tag oreowallet ${{ secrets.AWS_NODE_REGISTRY_URL }}/oreowallet:developer | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/oreowallet:developer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
.vscode | ||
.env | ||
dbconfig.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Use the official Rust image as a base | ||
FROM rust:latest AS builder | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the entire workspace | ||
COPY . . | ||
|
||
# Build the project | ||
RUN cargo build --release | ||
|
||
# Use a minimal base image for the final container | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libssl3 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the built binaries from the builder stage | ||
COPY --from=builder /app/target/release/server /app/server | ||
COPY --from=builder /app/target/release/chain_loader /app/chain_loader | ||
COPY --from=builder /app/target/release/dservice /app/dservice | ||
COPY --from=builder /app/target/release/dworker /app/dworker | ||
COPY --from=builder /app/target/release/prover /app/prover | ||
|
||
|
||
# Expose necessary ports | ||
EXPOSE 10002 9093 10001 20001 | ||
|
||
# Define the entry point for the container | ||
CMD ["./main"] |