-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
24 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
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,18 +1,24 @@ | ||
# build backend | ||
FROM rust:1.74.1-slim-bookworm as rust-builder | ||
FROM rust:1.74.1-slim-bullseye as rust-builder | ||
RUN apt update && apt install -y make clang pkg-config libssl-dev protobuf-compiler | ||
|
||
WORKDIR /rust-app | ||
COPY . /rust-app | ||
RUN cargo build --package moksha-mint --release | ||
RUN cargo build --package moksha-mint --release | ||
|
||
|
||
FROM alpine:3.19.0 | ||
COPY --from=rust-builder /rust-app/target/release/moksha-mint / | ||
FROM bitnami/minideb:bullseye | ||
COPY --from=rust-builder /rust-app/target/release/moksha-mint /app/ | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
COPY --chmod=755 ./entrypoint.sh /app/entrypoint.sh | ||
|
||
USER 1000 | ||
WORKDIR /app | ||
ENTRYPOINT ["./entrypoint.sh"] | ||
|
||
ARG BUILDTIME | ||
ARG COMMITHASH | ||
ENV BUILDTIME ${BUILDTIME} | ||
ENV COMMITHASH ${COMMITHASH} | ||
|
||
WORKDIR / | ||
CMD ["./moksha-mint"] |
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
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,23 +1,31 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$LND_MACAROON_BASE64" ] || [ -z "$LND_TLS_CERT_BASE64" ]; then | ||
echo "Warning: LND_MACAROON_BASE64 and LND_TLS_CERT_BASE64 not set" >&2 | ||
exec "$@" | ||
exit 0 | ||
fi | ||
|
||
# Decode the base64 environment variables and write them to files | ||
mkdir -p /lndconf | ||
echo "$LND_MACAROON_BASE64" | base64 -d > /lndconf/admin.macaroon | ||
mkdir -p /tmp/lndconf | ||
echo "$LND_MACAROON_BASE64" | base64 -d > /tmp/lndconf/admin.macaroon | ||
if [ $? -ne 0 ]; then | ||
echo "LND_MACAROON_BASE64 is not valid base64" | ||
exit 1 | ||
fi | ||
|
||
echo "$LND_TLS_CERT_BASE64" | base64 -d > /lndconf/tls.cert | ||
echo "$LND_TLS_CERT_BASE64" | base64 -d > /tmp/lndconf/tls.cert | ||
if [ $? -ne 0 ]; then | ||
echo "LND_TLS_CERT_BASE64 is not valid base64" | ||
exit 1 | ||
fi | ||
|
||
# Restrict permissions of the files | ||
chmod 700 /lndconf | ||
chmod 400 /lndconf/admin.macaroon | ||
chmod 400 /lndconf/tls.cert | ||
chmod 700 /tmp/lndconf | ||
chmod 400 /tmp/lndconf/admin.macaroon | ||
chmod 400 /tmp/lndconf/tls.cert | ||
|
||
#chown -R 1000:1000 /tmp/lndconf | ||
|
||
# Start your application | ||
exec "$@" |
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
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