FROM rust:1.66-slim as build # Install build dependencies RUN apt update \ && apt install -y --no-install-recommends lsb-release apt-transport-https \ build-essential curl wget pkg-config libssl-dev # Root of the project WORKDIR /app # retrieve the src dir COPY . . # RUN curl https://git.albv.org/alban/fast-insiders/archive/master.tar.gz | tar -xz # go to src dir # WORKDIR /app # Rocket only runs on Nightly RUN rustup default nightly ARG API_URL ENV API_URL=$API_URL # Build the final binary RUN cargo build --release --bin server # prepare deployment image FROM debian:stable-slim # For tls to work RUN apt-get update && apt-get -y install ca-certificates libssl-dev && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=build /app/target/release/server /app/ ENV ROCKET_ADDRESS=0.0.0.0 CMD ./server