Skip to content

Commit

Permalink
Make dockerfile build florestad (#96)
Browse files Browse the repository at this point in the history
* Make dockerfile build florestad

* push docker image on release
  • Loading branch information
Davidson-Souza authored Nov 18, 2023
1 parent 4c1323b commit 3713cfb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: dlsz/floresta:latest
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ FROM rust:1.66.0@sha256:0067330b7e0eacacc5c32f21b720607c0cd61eda905c8d55e6a745f5
WORKDIR /opt/app

COPY Cargo.* ./
COPY src/ src/

COPY florestad/ florestad/
COPY crates/ crates/
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo build --release

FROM debian:11.6-slim@sha256:171530d298096f0697da36b3324182e872db77c66452b85783ea893680cc1b62

COPY --from=builder /opt/app/target/release/floresta /usr/local/bin/floresta
RUN chmod +x /usr/local/bin/floresta
COPY --from=builder /opt/app/target/release/florestad /usr/local/bin/florestad
RUN chmod +x /usr/local/bin/florestad

EXPOSE 50001

CMD [ "floresta", "run"]
CMD [ "florestad", "run"]
7 changes: 0 additions & 7 deletions crates/floresta-chain/src/pruned_utreexo/chain_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ impl BlockConsumer for Channel<(Block, u32)> {
}
}

#[cfg(not(feature = "no-std"))]
impl BlockConsumer for std::sync::mpsc::Sender<(Block, u32)> {
fn consume_block(&self, block: &Block, height: u32) {
let _ = self.send((block.to_owned(), height));
}
}

pub struct ChainStateInner<PersistedState: ChainStore> {
/// The acc we use for validation.
acc: Stump,
Expand Down

0 comments on commit 3713cfb

Please sign in to comment.