-
Notifications
You must be signed in to change notification settings - Fork 0
Containerize market API rust server #24
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
78ab86f
feat(market-server-rust): add Dockerfile and docker-compose service f…
dfayd0 3dbffb4
docs(market-server-rust): add Docker build and run instructions to RE…
dfayd0 9ebd9e5
docs: add Docker Compose instructions and server README references
dfayd0 0a15a7e
perf(market-server-rust): optimize Dockerfile with cargo-chef and scc…
dfayd0 769f4b2
docs(market-data-ingestion): fix broken link in README
dfayd0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,60 @@ | ||
| FROM docker.io/library/rust:1.89-slim-bookworm AS base | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| pkg-config \ | ||
| libssl-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
guilhem-sante marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| RUN cargo install cargo-chef --version ^0.1 | ||
| RUN cargo install sccache --version ^0.7 | ||
|
|
||
| ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache | ||
|
|
||
| FROM base AS planner | ||
| WORKDIR /app | ||
| COPY Cargo.toml Cargo.lock ./ | ||
| COPY entity ./entity | ||
| COPY migration ./migration | ||
| COPY src ./src | ||
| RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
| --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \ | ||
| cargo chef prepare --recipe-path recipe.json | ||
|
|
||
| FROM base AS builder | ||
|
|
||
| WORKDIR /build | ||
|
|
||
| COPY --from=planner /app/recipe.json recipe.json | ||
| RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
| --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \ | ||
| cargo chef cook --release --recipe-path recipe.json | ||
|
|
||
| COPY Cargo.toml Cargo.lock ./ | ||
| COPY local ./local | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Je crois pas que tu ais besoin de
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pas sur de comprendre ce comment |
||
| COPY templates ./templates | ||
| COPY entity ./entity | ||
| COPY migration ./migration | ||
| COPY src ./src | ||
dfayd0 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
| --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \ | ||
| cargo build --release | ||
|
|
||
| FROM debian:bookworm-slim | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| ca-certificates \ | ||
| libssl3 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=builder /build/target/release/finwar-market /app/finwar-market | ||
| COPY templates ./templates | ||
| COPY local ./local | ||
|
|
||
| ENV RUST_LOG=info | ||
|
|
||
| EXPOSE 4444 | ||
|
|
||
| CMD ["/app/finwar-market"] | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.