Created
March 14, 2025 13:20
-
-
Save lil5/7b644dff7f77133e0543e0e85a5ccb76 to your computer and use it in GitHub Desktop.
Rust docker
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
FROM rust:bookworm AS rust | |
RUN apt-get update && apt install -y curl postgresql-client-15 libclang-dev | |
WORKDIR /app | |
COPY Cargo.toml Cargo.lock ./ | |
RUN cargo fetch --locked | |
COPY . . | |
ARG CARGO_BUILD_JOBS=default | |
RUN --mount=type=cache,target=/usr/local/cargo/registry \ | |
--mount=type=cache,target=/app/target \ | |
cargo build --release && cp /app/target/release/app /usr/bin/app | |
EXPOSE 8080 | |
ENTRYPOINT ["/usr/bin/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment