-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Dockerfile #1009
feat: add Dockerfile #1009
Conversation
Dockerfile
Outdated
|
||
RUN make deps | ||
|
||
CMD ["iex", "-S", "mix", "run", "--", "--checkpoint-sync-url", "https://sepolia.checkpoint-sync.ethpandaops.io/", "--network", "sepolia", "--metrics", "--validator-file", "validator_sepolia.txt"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use parameters or env variables here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to add support for env vars in place of CLI flags.
diff --git a/.dockerignore b/.dockerignore index 73d13859..00b5062c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,3 +15,4 @@ tmp/ .formatter.exs .spectest_version flake.* +native/**/target/ diff --git a/Dockerfile b/Dockerfile index 2441ae97..9e7899dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,11 @@ -FROM elixir:1.16.2 +FROM golang:1.21.3 AS go_builder + +RUN mkdir /libp2p_port +WORKDIR /libp2p_port + +COPY native/libp2p_port /libp2p_port/ + +FROM elixir:1.16.2-otp-26 RUN mkdir /app WORKDIR /app @@ -9,10 +16,14 @@ RUN mix local.hex --force # copy release to app container COPY . . +COPY --from=go_builder /libp2p_port /app/priv/native/libp2p_port + +RUN apt update && apt install -y cmake -RUN chown -R nobody: /app -USER nobody +RUN mix deps.get -RUN make deps +# TODO: the leveldb build script from eleveldb doesn't work +RUN mix compile +# CMD ["sh"] CMD ["iex", "-S", "mix", "run", "--", "--checkpoint-sync-url", "https://sepolia.checkpoint-sync.ethpandaops.io/", "--network", "sepolia", "--metrics", "--validator-file", "validator_sepolia.txt"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets go! 🚀
Closes #1000