diff --git a/Dockerfile b/Dockerfile index 9dbd6dc..ec83fb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,15 @@ FROM rust:1.93 AS builder WORKDIR /app +# Build dependencies first (cached until Cargo.toml/Cargo.lock change) COPY Cargo.toml Cargo.lock ./ +RUN mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs +ENV SQLX_OFFLINE=true +RUN cargo build --release && rm -rf src target/release/.fingerprint/happyview-* + +# Build application code COPY src/ src/ COPY migrations/ migrations/ - -ENV SQLX_OFFLINE=true RUN cargo build --release FROM debian:bookworm-slim diff --git a/src/aip.rs b/src/aip.rs index 29daa07..3ac7e40 100644 --- a/src/aip.rs +++ b/src/aip.rs @@ -43,7 +43,7 @@ pub async fn aip_proxy( let upstream_resp = match req.send().await { Ok(r) => r, Err(e) => { - tracing::error!("AIP proxy error: {e}"); + tracing::error!("AIP proxy error: {e:#}"); return Response::builder() .status(StatusCode::BAD_GATEWAY) .body(Body::from("upstream request failed"))