mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
message-queue and processor Dockerfiles
This commit is contained in:
@@ -18,6 +18,9 @@ All commands are assumed to be ran from `/deploy`, not the root folder.
|
|||||||
* `ethereum` - Ethereum node
|
* `ethereum` - Ethereum node
|
||||||
* `coins` - Nodes for all external networks (BTC, ETH, XMR)
|
* `coins` - Nodes for all external networks (BTC, ETH, XMR)
|
||||||
|
|
||||||
|
* `message-queue` - The message queue service.
|
||||||
|
* `processor` - Serai processor for one external network.
|
||||||
|
|
||||||
* `serai` - Serai node
|
* `serai` - Serai node
|
||||||
* `cluster-sm` - "Alice", "Bob", and "Charlie" Serai nodes, all validators
|
* `cluster-sm` - "Alice", "Bob", and "Charlie" Serai nodes, all validators
|
||||||
* `cluster-lg` - `cluster-sm` with non-validators "Dave", "Eve", and "Ferdie"
|
* `cluster-lg` - `cluster-sm` with non-validators "Dave", "Eve", and "Ferdie"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ version: "3.9"
|
|||||||
name: serai-dev
|
name: serai-dev
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
serai-base:
|
serai-node:
|
||||||
serai-alice:
|
serai-alice:
|
||||||
serai-bob:
|
serai-bob:
|
||||||
serai-charlie:
|
serai-charlie:
|
||||||
@@ -50,6 +50,32 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "18081:18081"
|
- "18081:18081"
|
||||||
|
|
||||||
|
# Infrastructure
|
||||||
|
|
||||||
|
message-queue:
|
||||||
|
profiles:
|
||||||
|
- message-queue
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
dockerfile: ./deploy/message-queue/Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- "./message-queue/scripts:/scripts"
|
||||||
|
entrypoint: /scripts/entry-dev.sh
|
||||||
|
ports:
|
||||||
|
- "2287:2287"
|
||||||
|
|
||||||
|
processor:
|
||||||
|
profiles:
|
||||||
|
- processor
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
dockerfile: ./deploy/processor/Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- "./processor/scripts:/scripts"
|
||||||
|
entrypoint: /scripts/entry-dev.sh
|
||||||
|
|
||||||
# Serai services
|
# Serai services
|
||||||
|
|
||||||
_serai:
|
_serai:
|
||||||
|
|||||||
62
deploy/message-queue/Dockerfile
Normal file
62
deploy/message-queue/Dockerfile
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
FROM docker.io/paritytech/ci-linux:production as builder
|
||||||
|
LABEL description="STAGE 1: Build"
|
||||||
|
|
||||||
|
# Add files for build
|
||||||
|
ADD common /serai/common
|
||||||
|
ADD crypto /serai/crypto
|
||||||
|
ADD coins /serai/coins
|
||||||
|
ADD message-queue /serai/message-queue
|
||||||
|
ADD processor /serai/processor
|
||||||
|
ADD coordinator /serai/coordinator
|
||||||
|
ADD substrate /serai/substrate
|
||||||
|
ADD tests /serai/tests
|
||||||
|
ADD Cargo.toml /serai
|
||||||
|
ADD Cargo.lock /serai
|
||||||
|
ADD AGPL-3.0 /serai
|
||||||
|
|
||||||
|
WORKDIR /serai
|
||||||
|
|
||||||
|
# Update Rust
|
||||||
|
RUN rustup update
|
||||||
|
|
||||||
|
# Install Solc @ 0.8.16
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
pip3 install solc-select==0.2.1
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
solc-select install 0.8.16
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
solc-select use 0.8.16
|
||||||
|
|
||||||
|
# Mount cargo and the Serai cache
|
||||||
|
RUN --mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
--mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
|
--mount=type=cache,target=/serai/target/release/build \
|
||||||
|
--mount=type=cache,target=/serai/target/release/deps \
|
||||||
|
--mount=type=cache,target=/serai/target/release/.fingerprint \
|
||||||
|
--mount=type=cache,target=/serai/target/release/incremental \
|
||||||
|
--mount=type=cache,target=/serai/target/release/wbuild \
|
||||||
|
--mount=type=cache,target=/serai/target/release/lib* \
|
||||||
|
cd message-queue && cargo build --release
|
||||||
|
|
||||||
|
# Prepare Image
|
||||||
|
FROM ubuntu:latest as image
|
||||||
|
LABEL description="STAGE 2: Copy and Run"
|
||||||
|
|
||||||
|
WORKDIR /home/serai
|
||||||
|
|
||||||
|
# Copy necessary files to run node
|
||||||
|
COPY --from=builder /serai/target/release/serai-message-queue /bin/
|
||||||
|
COPY --from=builder /serai/AGPL-3.0 .
|
||||||
|
|
||||||
|
# Run message-queue
|
||||||
|
EXPOSE 2287
|
||||||
|
CMD ["serai-message-queue"]
|
||||||
10
deploy/message-queue/scripts/entry-dev.sh
Executable file
10
deploy/message-queue/scripts/entry-dev.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export BITCOIN_KEY="0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
export ETHEREUM_KEY="0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
export MONERO_KEY="0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
export COORDINATOR_KEY="0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
|
||||||
|
export DB_PATH="./message-queue-db"
|
||||||
|
|
||||||
|
serai-message-queue
|
||||||
61
deploy/processor/Dockerfile
Normal file
61
deploy/processor/Dockerfile
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
FROM docker.io/paritytech/ci-linux:production as builder
|
||||||
|
LABEL description="STAGE 1: Build"
|
||||||
|
|
||||||
|
# Add files for build
|
||||||
|
ADD common /serai/common
|
||||||
|
ADD crypto /serai/crypto
|
||||||
|
ADD coins /serai/coins
|
||||||
|
ADD message-queue /serai/message-queue
|
||||||
|
ADD processor /serai/processor
|
||||||
|
ADD coordinator /serai/coordinator
|
||||||
|
ADD substrate /serai/substrate
|
||||||
|
ADD tests /serai/tests
|
||||||
|
ADD Cargo.toml /serai
|
||||||
|
ADD Cargo.lock /serai
|
||||||
|
ADD AGPL-3.0 /serai
|
||||||
|
|
||||||
|
WORKDIR /serai
|
||||||
|
|
||||||
|
# Update Rust
|
||||||
|
RUN rustup update
|
||||||
|
|
||||||
|
# Install Solc @ 0.8.16
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
pip3 install solc-select==0.2.1
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
solc-select install 0.8.16
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
solc-select use 0.8.16
|
||||||
|
|
||||||
|
# Mount cargo and the Serai cache
|
||||||
|
RUN --mount=type=cache,target=/root/.local/ \
|
||||||
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
|
--mount=type=cache,target=/root/.cache/ \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
|
--mount=type=cache,target=/serai/target/release/build \
|
||||||
|
--mount=type=cache,target=/serai/target/release/deps \
|
||||||
|
--mount=type=cache,target=/serai/target/release/.fingerprint \
|
||||||
|
--mount=type=cache,target=/serai/target/release/incremental \
|
||||||
|
--mount=type=cache,target=/serai/target/release/wbuild \
|
||||||
|
--mount=type=cache,target=/serai/target/release/lib* \
|
||||||
|
cd processor && cargo build --release
|
||||||
|
|
||||||
|
# Prepare Image
|
||||||
|
FROM ubuntu:latest as image
|
||||||
|
LABEL description="STAGE 2: Copy and Run"
|
||||||
|
|
||||||
|
WORKDIR /home/serai
|
||||||
|
|
||||||
|
# Copy necessary files to run node
|
||||||
|
COPY --from=builder /serai/target/release/ /bin/
|
||||||
|
COPY --from=builder /serai/AGPL-3.0 .
|
||||||
|
|
||||||
|
# Run processor
|
||||||
|
CMD ["processor"]
|
||||||
11
deploy/processor/scripts/entry-dev.sh
Executable file
11
deploy/processor/scripts/entry-dev.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export MESSAGE_QUEUE_KEY="0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
export MESSAGE_QUEUE_RPC="http://127.0.0.1:2287"
|
||||||
|
|
||||||
|
export DB_PATH="./bitcoin-db"
|
||||||
|
export ENTROPY="0001020304050607080910111213141516171819202122232425262728293031"
|
||||||
|
export NETWORK_RPC="http://serai:seraidex@127.0.0.1:18443"
|
||||||
|
export NETWORK="bitcoin"
|
||||||
|
|
||||||
|
serai-processor
|
||||||
@@ -45,7 +45,7 @@ RUN --mount=type=cache,target=/root/.local/ \
|
|||||||
--mount=type=cache,target=/serai/target/release/incremental \
|
--mount=type=cache,target=/serai/target/release/incremental \
|
||||||
--mount=type=cache,target=/serai/target/release/wbuild \
|
--mount=type=cache,target=/serai/target/release/wbuild \
|
||||||
--mount=type=cache,target=/serai/target/release/lib* \
|
--mount=type=cache,target=/serai/target/release/lib* \
|
||||||
cargo build --release
|
cd substrate/node && cargo build --release
|
||||||
|
|
||||||
# Prepare Image
|
# Prepare Image
|
||||||
FROM ubuntu:latest as image
|
FROM ubuntu:latest as image
|
||||||
|
|||||||
Reference in New Issue
Block a user