-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CI build artifacts for docker container to improve build performa…
…nce (#1179)
- Loading branch information
Showing
2 changed files
with
46 additions
and
35 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
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 |
---|---|---|
@@ -1,37 +1,16 @@ | ||
FROM rust:slim-buster as builder | ||
RUN apt-get -y update; \ | ||
apt-get install -y --no-install-recommends \ | ||
curl libssl-dev make clang-11 g++ llvm protobuf-compiler \ | ||
pkg-config libz-dev zstd git; \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/* | ||
FROM debian:buster-slim as base | ||
|
||
WORKDIR /dojo | ||
COPY . . | ||
RUN cargo build --release --config net.git-fetch-with-cli=true | ||
|
||
FROM debian:buster-slim | ||
LABEL description="Dojo is a provable game engine and toolchain for building onchain games and autonomous worlds with Cairo" \ | ||
authors="tarrence <[email protected]>" \ | ||
source="https://github.com/dojoengine/dojo" \ | ||
documentation="https://book.dojoengine.org/" | ||
|
||
RUN apt-get -y update; \ | ||
apt-get install -y --no-install-recommends \ | ||
curl; \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set an environment variable for the port | ||
ENV HEALTH_CHECK_PORT=5050 | ||
|
||
HEALTHCHECK --interval=3s --timeout=5s --start-period=1s --retries=5 \ | ||
CMD curl --request POST \ | ||
--header "Content-Type: application/json" \ | ||
--data '{"jsonrpc": "2.0","method": "starknet_chainId","id":1}' http://localhost:${HEALTH_CHECK_PORT} || exit 1 | ||
FROM base as amd64 | ||
COPY target/x86_64-unknown-linux-gnu/release/katana /usr/local/bin/katana | ||
COPY target/x86_64-unknown-linux-gnu/release/sozo /usr/local/bin/sozo | ||
COPY target/x86_64-unknown-linux-gnu/release/torii /usr/local/bin/torii | ||
|
||
COPY --from=builder /dojo/target/release/katana /usr/local/bin/katana | ||
COPY --from=builder /dojo/target/release/sozo /usr/local/bin/sozo | ||
COPY --from=builder /dojo/target/release/torii /usr/local/bin/torii | ||
FROM base as arm64 | ||
COPY target/aarch64-unknown-linux-gnu/release/katana /usr/local/bin/katana | ||
COPY target/aarch64-unknown-linux-gnu/release/sozo /usr/local/bin/sozo | ||
COPY target/aarch64-unknown-linux-gnu/release/torii /usr/local/bin/torii |