Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio committed Mar 12, 2024
1 parent 4f56323 commit a50c94a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLATFORM_KEY=example
KEY_PASS=example
CONFIG_FILE=/opt/app/config.json
RUST_LOG=wallet=trace
RUST_LOG=wallet_lib=warn
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Autodetect text files
* text=auto

# Ensure shell script uses LF.
Dockerfile eol=lf
*.sh eol=lf
.env eol=lf
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ===== FIRST STAGE ======

FROM rust:1.76-buster as builder
LABEL description="This is the build stage for the wallet. Here we create the binary."

Expand All @@ -8,14 +10,14 @@ RUN cargo build --release

# ===== SECOND STAGE ======

FROM debian:buster-slim
FROM debian:buster-slim as runner
LABEL description="This is the 2nd stage: a very small image where we copy the wallet binary."
# reqwest needs libssl and curl is needed to install the ca-certificates
# awscli is needed for the start script to retrieve the secrets
RUN apt-get update && \
apt-get install -y \
libssl-dev \
wait-for-it \
dos2unix \
jq \
curl \
zip && \
Expand All @@ -24,11 +26,18 @@ RUN apt-get update && \
unzip /tmp/awscliv2.zip -d /tmp/awscli && \
/tmp/awscli/aws/install && \
rm -rf /tmp/awscli*

RUN rm -rf /var/lib/apt/lists/*

COPY --from=builder /wallet/target/release/wallet /usr/local/bin
COPY --from=builder /wallet/scripts/start.sh /usr/local/bin
RUN chmod +x /usr/local/bin/start.sh
# ===== THIRD STAGE ======

FROM runner

WORKDIR wallet

COPY --chmod=0755 --from=builder /wallet/target/release/wallet /usr/local/bin
COPY --chmod=0755 --from=builder /wallet/scripts/start.sh /wallet/start.sh
RUN dos2unix start.sh

# STORE_NAME = the storage name, this is a hex number which is the file name where the key is stored,
# it's generated when the key is generate (In the current example: `73723235301cb3057d43941d5f631613aa1661be0354d39e34f23d4ef527396b10d2bb7a`)
Expand Down

0 comments on commit a50c94a

Please sign in to comment.