-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from weareseba/feature/docker
adding a dockerfile to run it
- Loading branch information
Showing
5 changed files
with
51 additions
and
30 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,5 @@ | ||
target/ | ||
.git/ | ||
.github/ | ||
Dockerfile | ||
Makefile |
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
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,22 @@ | ||
FROM rust:1.72-alpine3.18 as builder | ||
RUN apk add --no-cache build-base | ||
USER bin | ||
WORKDIR /app | ||
COPY . . | ||
RUN cargo test | ||
RUN cargo build --release | ||
RUN install -D target/release/bdk-reserves-web dist/bin/bdk-reserves-web | ||
RUN ldd dist/bin/bdk-reserves-web | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % dist/% | ||
RUN ln -s ld-musl-x86_64.so.1 dist/lib/libc.musl-x86_64.so.1 | ||
|
||
RUN rustup component add clippy-preview \ | ||
&& rustup component add rustfmt | ||
RUN cargo install cargo-audit | ||
RUN cargo fmt -- --check | ||
RUN cargo clippy | ||
#RUN cargo audit | ||
|
||
FROM scratch | ||
COPY --from=builder /app/dist / | ||
USER 65534 | ||
ENTRYPOINT ["/bin/bdk-reserves-web"] |
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,7 @@ | ||
TAG := bdk-reserves-web | ||
|
||
run: builder | ||
docker run --rm --tty --env PORT=8888 --publish 8888:8888 ${TAG} | ||
|
||
builder: | ||
docker build --tag ${TAG} . |