FROM rust:1 RUN rustup component add rustfmt WORKDIR /project RUN apt-get update && apt-get -y install python3 python3-pip python3-venv python3-dev # Build dependencies RUN mkdir src RUN echo "fn main() {}" >> src/main.rs COPY Cargo.toml Cargo.toml RUN cargo build RUN rm -f src/main.rs COPY src src RUN cargo build --release # Extract binary RUN cp target/release/server /project/server CMD ["/project/server"]