FROM rust:1.80 AS builder WORKDIR /code COPY Cargo.toml Cargo.lock ./ RUN mkdir src && echo "fn main() {}" > src/main.rs RUN cargo build --release COPY src src RUN cargo install --path . FROM debian:bookworm-slim AS runtime RUN apt-get update && \ apt-get install -y --no-install-recommends sqlite3 libsqlite3-dev && \ rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /usr/local/cargo/bin/script_hoster . COPY src/static_pages src/static_pages COPY src/error_pages src/error_pages COPY src/assets src/assets EXPOSE 3000 CMD ["./script_hoster"]