-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Local development & add steps in
README.md
(#173)
- Loading branch information
1 parent
8189a09
commit dc69002
Showing
5 changed files
with
90 additions
and
73 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
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,30 +1,16 @@ | ||
FROM rust:1.68 AS build | ||
|
||
ARG CARGO_BUILD_MODE=release | ||
WORKDIR /tmp/ | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY storage/Cargo.toml ./storage/ | ||
COPY indexer_rule_type/Cargo.toml ./indexer_rule_type/ | ||
COPY indexer_rules_engine/Cargo.toml ./indexer_rules_engine/ | ||
COPY queryapi_coordinator/Cargo.toml ./queryapi_coordinator/ | ||
|
||
# We have to use sparse-registry cargo feature to avoid running out of RAM (version 1.68+) | ||
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse | ||
RUN /bin/bash -c "mkdir -p {queryapi_coordinator,indexer_rule_type,indexer_rules_engine,storage}/src" && \ | ||
echo 'fn main() {}' > queryapi_coordinator/src/main.rs && \ | ||
touch indexer_rule_type/src/lib.rs && \ | ||
touch indexer_rules_engine/src/lib.rs && \ | ||
touch storage/src/lib.rs && \ | ||
cargo build | ||
|
||
COPY ./ ./ | ||
|
||
RUN cargo build --release --package queryapi_coordinator --offline | ||
|
||
RUN if [ "$CARGO_BUILD_MODE" = "debug" ]; then \ | ||
cargo build --package queryapi_coordinator --offline; \ | ||
else \ | ||
cargo build --release --package queryapi_coordinator --offline; \ | ||
fi | ||
|
||
FROM ubuntu:20.04 | ||
|
||
ARG CARGO_BUILD_MODE=release | ||
RUN apt update && apt install -yy openssl ca-certificates | ||
|
||
USER nobody | ||
COPY --from=build /tmp/target/release/queryapi_coordinator /queryapi_coordinator | ||
COPY --from=build /tmp/target/$CARGO_BUILD_MODE/queryapi_coordinator /queryapi_coordinator | ||
ENTRYPOINT ["/queryapi_coordinator"] |
This file was deleted.
Oops, something went wrong.
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