-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Docker image to the template (#69)
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 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,2 @@ | ||
**/target/ | ||
Dockerfile |
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,36 @@ | ||
# Note: This is currently designed to simplify development | ||
# To get a smaller docker image, there should be 2 images generated, in 2 stages. | ||
|
||
FROM rustlang/rust:nightly | ||
|
||
|
||
ARG PROFILE=release | ||
WORKDIR /frontier | ||
|
||
# Upcd dates core parts | ||
RUN apt-get update -y && \ | ||
apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev | ||
|
||
# Install rust wasm. Needed for substrate wasm engine | ||
RUN rustup target add wasm32-unknown-unknown | ||
|
||
# Download Frontier repo | ||
RUN git clone https://github.com/paritytech/frontier /frontier | ||
RUN cd /frontier && git submodule init && git submodule update | ||
|
||
# Download rust dependencies and build the rust binary | ||
RUN cargo build "--$PROFILE" | ||
|
||
# 30333 for p2p traffic | ||
# 9933 for RPC call | ||
# 9944 for Websocket | ||
# 9615 for Prometheus (metrics) | ||
EXPOSE 30333 9933 9944 9615 | ||
|
||
|
||
ENV PROFILE ${PROFILE} | ||
|
||
# The execution will re-compile the project to run it | ||
# This allows to modify the code and not have to re-compile the | ||
# dependencies. | ||
CMD cargo run "--$PROFILE" -- --dev |
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