# syntax=docker/dockerfile:1.4 FROM rust:1-bookworm AS build RUN cargo install sqlx-cli@0.8.2 --no-default-features --features sqlite RUN cargo install sccache --version ^0.8 ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache RUN USER=root cargo new --bin supercell RUN mkdir -p /app/ WORKDIR /app/ ARG GIT_HASH ENV GIT_HASH=$GIT_HASH ARG CARGO_FEATURES RUN --mount=type=bind,source=src,target=src \ --mount=type=bind,source=migrations,target=migrations \ --mount=type=bind,source=Cargo.toml,target=Cargo.toml \ --mount=type=bind,source=Cargo.lock,target=Cargo.lock \ --mount=type=cache,target=/app/target/ \ --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \ --mount=type=cache,target=/usr/local/cargo/registry/ \ <