Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dan moore authored and dan moore committed Jul 27, 2022
1 parent 87128f3 commit 517c52e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Phase 0: Builder
# =========================
FROM paritytech/ci-linux:production as builder

RUN apt-get update && \
apt-get install -y git openssh-client && \
rm -rf /var/lib/apt/lists && \
mkdir -p /avail

COPY . /avail/

RUN \
mkdir -p /da/bin && \
mkdir -p /da/genesis && \
# Build DA \
cp -r /avail/misc/genesis /da && \
cd /avail && \
cargo build --release -p data-avail && \
# Install binaries \
mv target/release/data-avail /da/bin


# Phase 1: Binary deploy
# =========================
FROM debian:buster-slim

RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists

COPY --from=builder /da/ /da
COPY entrypoint.sh /
WORKDIR /da

ENV \
DA_CHAIN="/da/genesis/testnet.chain.spec.raw.json" \
DA_NAME="AvailNode" \
DA_MAX_IN_PEERS=50 \
DA_MAX_OUT_PEERS=50 \
DA_P2P_PORT="30333"

VOLUME ["/tmp", "/da/state", "/da/keystore"]
ENTRYPOINT ["/entrypoint.sh"]
25 changes: 25 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
cat /entrypoint.sh;

trap cleanup 1 2 3 6

cleanup()
{
echo "Done cleanup ... quitting."
exit 1
}

/da/bin/data-avail \
--validator \
--base-path /da/state \
--keystore-path /da/keystore \
--execution=NativeElseWasm \
--offchain-worker=Always \
--enable-offchain-indexing=true \
--name $DA_NAME \
--chain $DA_CHAIN \
--port $DA_P2P_PORT \
--bootnodes=/ip4/52.47.205.129/tcp/30333/p2p/12D3KooW9tVuCzq3eknsevL5uyqQ3LpVcuqtkTqropjNccbhsWBz \
--bootnodes=/ip4/15.237.127.118/tcp/30333/p2p/12D3KooWQtxig5HukFDwQzshGWgQEZAqGqdCN7AQBW7cQRJWCyxL \
--bootnodes=/ip4/52.47.205.129/tcp/30333/p2p/12D3KooW9tVuCzq3eknsevL5uyqQ3LpVcuqtkTqropjNccbhsWBz \
$@

0 comments on commit 517c52e

Please sign in to comment.